diff options
Diffstat (limited to 'CPP/Common/UTFConvert.cpp')
-rw-r--r-- | CPP/Common/UTFConvert.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/CPP/Common/UTFConvert.cpp b/CPP/Common/UTFConvert.cpp index fb166b7..509de76 100644 --- a/CPP/Common/UTFConvert.cpp +++ b/CPP/Common/UTFConvert.cpp | |||
@@ -135,7 +135,7 @@ we can place 128 ESCAPE chars to | |||
135 | #endif | 135 | #endif |
136 | 136 | ||
137 | #define IS_SURROGATE_POINT(v) (((v) & (UInt32)0xfffff800) == 0xd800) | 137 | #define IS_SURROGATE_POINT(v) (((v) & (UInt32)0xfffff800) == 0xd800) |
138 | #define IS_LOW_SURROGATE_POINT(v) (((v) & (UInt32)0xfffffC00) == 0xdc00) | 138 | #define IS_LOW_SURROGATE_POINT(v) (((v) & (UInt32)0xfffffc00) == 0xdc00) |
139 | 139 | ||
140 | 140 | ||
141 | #define UTF_ERROR_UTF8_CHECK \ | 141 | #define UTF_ERROR_UTF8_CHECK \ |
@@ -168,14 +168,14 @@ void CUtf8Check::Check_Buf(const char *src, size_t size) throw() | |||
168 | if (c < 0x80) | 168 | if (c < 0x80) |
169 | continue; | 169 | continue; |
170 | 170 | ||
171 | if (c < 0xc0 + 2) // it's limit for 0x140000 unicode codes : win32 compatibility | 171 | if (c < 0xc0 + 2) |
172 | UTF_ERROR_UTF8_CHECK | 172 | UTF_ERROR_UTF8_CHECK |
173 | 173 | ||
174 | unsigned numBytes; | 174 | unsigned numBytes; |
175 | |||
176 | UInt32 val = c; | 175 | UInt32 val = c; |
177 | MY_UTF8_HEAD_PARSE2(1) | 176 | MY_UTF8_HEAD_PARSE2(1) |
178 | else MY_UTF8_HEAD_PARSE2(2) | 177 | else MY_UTF8_HEAD_PARSE2(2) |
178 | else MY_UTF8_HEAD_PARSE2(3) | ||
179 | else MY_UTF8_HEAD_PARSE2(4) | 179 | else MY_UTF8_HEAD_PARSE2(4) |
180 | else MY_UTF8_HEAD_PARSE2(5) | 180 | else MY_UTF8_HEAD_PARSE2(5) |
181 | else | 181 | else |
@@ -768,7 +768,7 @@ void Convert_UTF16_To_UTF32(const UString &src, UString &dest) | |||
768 | if (c >= 0xd800 && c < 0xdc00 && i < src.Len()) | 768 | if (c >= 0xd800 && c < 0xdc00 && i < src.Len()) |
769 | { | 769 | { |
770 | const wchar_t c2 = src[i]; | 770 | const wchar_t c2 = src[i]; |
771 | if (c2 >= 0xdc00 && c2 < 0x10000) | 771 | if (c2 >= 0xdc00 && c2 < 0xe000) |
772 | { | 772 | { |
773 | // printf("\nSurragate [%d]: %4x %4x -> ", i, (int)c, (int)c2); | 773 | // printf("\nSurragate [%d]: %4x %4x -> ", i, (int)c, (int)c2); |
774 | c = 0x10000 + ((c & 0x3ff) << 10) + (c2 & 0x3ff); | 774 | c = 0x10000 + ((c & 0x3ff) << 10) + (c2 & 0x3ff); |