[vlc-commits] Fix surrogate detection
Rémi Denis-Courmont
git at videolan.org
Fri Mar 16 10:39:40 CET 2012
vlc/vlc-1.1 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Mar 16 11:38:01 2012 +0200| [0e321eb2b13a6ce7f6a31fb4a69766a48e092b4b] | committer: Rémi Denis-Courmont
Fix surrogate detection
(cherry picked from commit 8bce50f4b059f638d5f92323e6fec8c5318c432a)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=0e321eb2b13a6ce7f6a31fb4a69766a48e092b4b
---
src/text/unicode.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/text/unicode.c b/src/text/unicode.c
index c9075a8..ca0f181 100644
--- a/src/text/unicode.c
+++ b/src/text/unicode.c
@@ -348,7 +348,7 @@ size_t vlc_towc (const char *str, uint32_t *restrict pwc)
return -1;
cp |= (c & 0x3f) << 6;
- if (unlikely(cp >= 0xD800 && cp < 0xC000)) // UTF-16 surrogate
+ if (unlikely(cp >= 0xD800 && cp < 0xE000)) // UTF-16 surrogate
return -1;
if (unlikely(cp < (1u << (5 * charlen - 4)))) // non-ASCII overlong
return -1;
More information about the vlc-commits
mailing list