[vlc-commits] Fix surrogate detection

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


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

Fix surrogate detection

(cherry picked from commit 8bce50f4b059f638d5f92323e6fec8c5318c432a)

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

 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