diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-04-16 20:20:16 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-04-16 20:20:16 -0700 |
commit | ffe1230ab0e3dfda564ee8704a85cc4eb222fe54 (patch) | |
tree | e3e3807b7fd9e4a0f9f6ddbbff25d5dc6516ac8f | |
parent | f8c18d68e95d63bda55c77100fe395a7882bb71c (diff) | |
parent | 1111672722f0805cec39076d640d9c1acd2da4c8 (diff) |
Merge pull request #28 from nwellnhof/accept_unicode_nonchars
Pass-through Unicode non-characters
-rw-r--r-- | src/utf8.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -172,8 +172,7 @@ int utf8proc_iterate(const uint8_t *str, int str_len, int32_t *dst) case 3: uc = ((str[0] & 0x0F) << 12) + ((str[1] & 0x3F) << 6) + (str[2] & 0x3F); - if (uc < 0x800 || (uc >= 0xD800 && uc < 0xE000) || - (uc >= 0xFDD0 && uc < 0xFDF0)) uc = -1; + if (uc < 0x800 || (uc >= 0xD800 && uc < 0xE000)) uc = -1; break; case 4: uc = ((str[0] & 0x07) << 18) + ((str[1] & 0x3F) << 12) @@ -182,7 +181,7 @@ int utf8proc_iterate(const uint8_t *str, int str_len, int32_t *dst) break; } - if (uc < 0 || ((uc & 0xFFFF) >= 0xFFFE)) + if (uc < 0) return -1; *dst = uc; |