[vlc-commits] Fix surrogate detection

Rémi Denis-Courmont git at videolan.org
Fri Mar 16 10:38:19 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Mar 16 11:38:01 2012 +0200| [8bce50f4b059f638d5f92323e6fec8c5318c432a] | committer: Rémi Denis-Courmont

Fix surrogate detection

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8bce50f4b059f638d5f92323e6fec8c5318c432a
---

 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 c71a534..4dd95b3 100644
--- a/src/text/unicode.c
+++ b/src/text/unicode.c
@@ -280,7 +280,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