]> git.eshelyaron.com Git - emacs.git/commitdiff
(base64_encode_1): Handle eight-bit chars correctly.
authorKenichi Handa <handa@m17n.org>
Thu, 22 Aug 2002 01:18:39 +0000 (01:18 +0000)
committerKenichi Handa <handa@m17n.org>
Thu, 22 Aug 2002 01:18:39 +0000 (01:18 +0000)
src/fns.c

index 2a4428164053359381d516564548182973b6d50c..5865cdf1a930dbe08ae53f83c31aa69374cc3d7e 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -3047,7 +3047,9 @@ base64_encode_1 (from, to, length, line_break, multibyte)
       if (multibyte)
        {
          c = STRING_CHAR_AND_LENGTH (from + i, length - i, bytes);
-         if (c >= 256)
+         if (CHAR_BYTE8_P (c))
+           c = CHAR_TO_BYTE8 (c);
+         else if (c >= 256)
            return -1;
          i += bytes;
        }
@@ -3085,7 +3087,9 @@ base64_encode_1 (from, to, length, line_break, multibyte)
       if (multibyte)
        {
          c = STRING_CHAR_AND_LENGTH (from + i, length - i, bytes);
-         if (c >= 256)
+         if (CHAR_BYTE8_P (c))
+           c = CHAR_TO_BYTE8 (c);
+         else if (c >= 256)
            return -1;
          i += bytes;
        }
@@ -3107,7 +3111,9 @@ base64_encode_1 (from, to, length, line_break, multibyte)
       if (multibyte)
        {
          c = STRING_CHAR_AND_LENGTH (from + i, length - i, bytes);
-         if (c >= 256)
+         if (CHAR_BYTE8_P (c))
+           c = CHAR_TO_BYTE8 (c);
+         else if (c >= 256)
            return -1;
          i += bytes;
        }