summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2002-08-22 01:18:39 +0000
committerKenichi Handa <handa@m17n.org>2002-08-22 01:18:39 +0000
commit680d4b87f3d88a8b79f883cf3635036747588250 (patch)
treef7631a67cc7b1d84ffdfd7fb7bb0c4598cbef67e /src
parenta2974661fb866736365377ef7fede57531134219 (diff)
downloademacs-680d4b87f3d88a8b79f883cf3635036747588250.tar.gz
(base64_encode_1): Handle eight-bit chars correctly.
Diffstat (limited to 'src')
-rw-r--r--src/fns.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/fns.c b/src/fns.c
index 2a442816405..5865cdf1a93 100644
--- 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;
}