[vlc-commits] strings: add missing support for hexadecimal XML chracter encoding

Rémi Denis-Courmont git at videolan.org
Sun Nov 9 19:10:22 CET 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Nov  9 20:08:35 2014 +0200| [3eee999c45a150aede6233e7bbd7064949c84012] | committer: Rémi Denis-Courmont

strings: add missing support for hexadecimal XML chracter encoding

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

 src/text/strings.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/text/strings.c b/src/text/strings.c
index 55738a7..933dd9c 100644
--- a/src/text/strings.c
+++ b/src/text/strings.c
@@ -202,9 +202,15 @@ void resolve_xml_special_chars( char *psz_value )
         if( *psz_value == '&' )
         {
             if( psz_value[1] == '#' )
-            {   /* &#xxx; Unicode code point */
+            {   /* &#DDD; or &#xHHHH; Unicode code point */
                 char *psz_end;
-                unsigned long cp = strtoul( psz_value+2, &psz_end, 10 );
+                unsigned long cp;
+
+                if( psz_value[2] == 'x' ) /* The x must be lower-case. */
+                    cp = strtoul( psz_value + 3, &psz_end, 16 );
+                else
+                    cp = strtoul( psz_value + 2, &psz_end, 10 );
+
                 if( *psz_end == ';' )
                 {
                     psz_value = psz_end + 1;



More information about the vlc-commits mailing list