Commit e8630fd4 authored by KO Myung-Hun's avatar KO Myung-Hun Committed by Rémi Denis-Courmont

Treat UTF-16 as UCS-2 on OS/2

OS/2 supports UCS-2 only instead of UTF-16.
Signed-off-by: default avatarRafaël Carré <funman@videolan.org>
(cherry picked from commit 2cc70e68)
Signed-off-by: default avatarKO Myung-Hun <komh@chollian.net>
Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent 12b32fae
...@@ -326,6 +326,23 @@ vlc_iconv_t vlc_iconv_open( const char *tocode, const char *fromcode ) ...@@ -326,6 +326,23 @@ vlc_iconv_t vlc_iconv_open( const char *tocode, const char *fromcode )
return (vlc_iconv_t)(-2); return (vlc_iconv_t)(-2);
#endif #endif
#if defined(HAVE_ICONV) #if defined(HAVE_ICONV)
# if defined(__OS2__) && defined(__INNOTEK_LIBC__)
char tocode_ucs2[] = "UCS-2LE";
char fromcode_ucs2[] = "UCS-2LE";
/* Workaround for UTF-16 because OS/2 supports UCS-2 only not UTF-16 */
if( !strncmp( tocode, "UTF-16", 6 ))
{
strncpy( tocode_ucs2 + 5, tocode + 6, 2 );
tocode = tocode_ucs2;
}
if( !strncmp( fromcode, "UTF-16", 6 ))
{
strncpy( fromcode_ucs2 + 5, fromcode + 6, 2 );
fromcode = fromcode_ucs2;
}
# endif
return iconv_open( tocode, fromcode ); return iconv_open( tocode, fromcode );
#else #else
return (vlc_iconv_t)(-1); return (vlc_iconv_t)(-1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment