changeset 89046:7a6ebd6b0c38

(base64_encode_1): Handle eight-bit chars correctly.
author Kenichi Handa <handa@m17n.org>
date Thu, 22 Aug 2002 01:18:39 +0000
parents 556a246801fb
children 3b6234eb229c
files src/fns.c
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/fns.c	Thu Aug 22 01:08:26 2002 +0000
+++ b/src/fns.c	Thu Aug 22 01:18:39 2002 +0000
@@ -3047,7 +3047,9 @@
       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 @@
       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 @@
       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;
 	}