Mercurial > emacs
comparison src/fns.c @ 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 | 2383f41c7b8a |
children | 5dee2a648800 |
comparison
equal
deleted
inserted
replaced
89045:556a246801fb | 89046:7a6ebd6b0c38 |
---|---|
3045 while (i < length) | 3045 while (i < length) |
3046 { | 3046 { |
3047 if (multibyte) | 3047 if (multibyte) |
3048 { | 3048 { |
3049 c = STRING_CHAR_AND_LENGTH (from + i, length - i, bytes); | 3049 c = STRING_CHAR_AND_LENGTH (from + i, length - i, bytes); |
3050 if (c >= 256) | 3050 if (CHAR_BYTE8_P (c)) |
3051 c = CHAR_TO_BYTE8 (c); | |
3052 else if (c >= 256) | |
3051 return -1; | 3053 return -1; |
3052 i += bytes; | 3054 i += bytes; |
3053 } | 3055 } |
3054 else | 3056 else |
3055 c = from[i++]; | 3057 c = from[i++]; |
3083 } | 3085 } |
3084 | 3086 |
3085 if (multibyte) | 3087 if (multibyte) |
3086 { | 3088 { |
3087 c = STRING_CHAR_AND_LENGTH (from + i, length - i, bytes); | 3089 c = STRING_CHAR_AND_LENGTH (from + i, length - i, bytes); |
3088 if (c >= 256) | 3090 if (CHAR_BYTE8_P (c)) |
3091 c = CHAR_TO_BYTE8 (c); | |
3092 else if (c >= 256) | |
3089 return -1; | 3093 return -1; |
3090 i += bytes; | 3094 i += bytes; |
3091 } | 3095 } |
3092 else | 3096 else |
3093 c = from[i++]; | 3097 c = from[i++]; |
3105 } | 3109 } |
3106 | 3110 |
3107 if (multibyte) | 3111 if (multibyte) |
3108 { | 3112 { |
3109 c = STRING_CHAR_AND_LENGTH (from + i, length - i, bytes); | 3113 c = STRING_CHAR_AND_LENGTH (from + i, length - i, bytes); |
3110 if (c >= 256) | 3114 if (CHAR_BYTE8_P (c)) |
3115 c = CHAR_TO_BYTE8 (c); | |
3116 else if (c >= 256) | |
3111 return -1; | 3117 return -1; |
3112 i += bytes; | 3118 i += bytes; |
3113 } | 3119 } |
3114 else | 3120 else |
3115 c = from[i++]; | 3121 c = from[i++]; |