diff options
author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2009-04-06 00:28:05 +0100 |
---|---|---|
committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2009-04-06 00:28:05 +0100 |
commit | 317aec21b9ccbbc288eb428e1d74a51723a2b953 (patch) | |
tree | d984ce931c951d89d9ed4b2cd3ef0dc03cd1a786 /src/xine-engine/info_helper.c | |
parent | 699f3239e00a5ff922cf52a22389be0d2fb86bd7 (diff) | |
parent | a6bc7ed17d202107208bbe637ca92d5886c3d686 (diff) | |
download | xine-lib-317aec21b9ccbbc288eb428e1d74a51723a2b953.tar.gz xine-lib-317aec21b9ccbbc288eb428e1d74a51723a2b953.tar.bz2 |
Merge from 1.1.
Diffstat (limited to 'src/xine-engine/info_helper.c')
-rw-r--r-- | src/xine-engine/info_helper.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/xine-engine/info_helper.c b/src/xine-engine/info_helper.c index b4a4bca83..2b09dcd3b 100644 --- a/src/xine-engine/info_helper.c +++ b/src/xine-engine/info_helper.c @@ -251,7 +251,15 @@ static void meta_info_set_unlocked_encoding(xine_stream_t *stream, int info, con size_t inbytesleft, outbytesleft; inbuf = (ICONV_CONST char *)value; - inbytesleft = strlen(value); + if (!strncmp (enc, "UTF-16", 6) || !strncmp (enc, "UCS-2", 5)) + { + /* strlen() won't work with UTF-16* or UCS-2* */ + inbytesleft = 0; + while (value[inbytesleft] || value[inbytesleft + 1]) + inbytesleft += 2; + } /* ... do we need to handle UCS-4? Probably not. */ + else + inbytesleft = strlen(value); outbytesleft = 4 * inbytesleft; /* estimative (max) */ outbuf = utf8_value = malloc(outbytesleft+1); |