diff options
author | Alexey Yakovenko <waker@users.sourceforge.net> | 2013-09-01 16:42:37 +0200 |
---|---|---|
committer | Alexey Yakovenko <waker@users.sourceforge.net> | 2013-09-01 16:42:37 +0200 |
commit | 2512f5aa7236257f8a0d7d718ece54d16c44b9f5 (patch) | |
tree | ba3bc6224372ab8b6f8bf79bf8cbfe41ec6a1278 /junklib.c | |
parent | 0ddcf20ace52eb9e67201838964f6dc7faba0a3a (diff) |
junklib: fixed utf8->utf16 conversion without iconv
Diffstat (limited to 'junklib.c')
-rw-r--r-- | junklib.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -331,8 +331,8 @@ int ddb_iconv (const char *cs_out, const char *cs_in, char *out, int outlen, con return 0; } // to utf8 branch - if (!strcmp (cs_out, UTF8_STR)) { - if (!strcmp (cs_in, UTF8_STR)) { + if (!strcasecmp (cs_out, UTF8_STR)) { + if (!strcasecmp (cs_in, UTF8_STR)) { memcpy (out, in, inlen); out[inlen] = 0; int valid = u8_valid (out, inlen, NULL); @@ -423,7 +423,7 @@ int ddb_iconv (const char *cs_out, const char *cs_in, char *out, int outlen, con fprintf (stderr, "invalid conversion request: %s -> %s\n", cs_in, cs_out); } } - else if (!strcmp (cs_in, UTF8_STR)) { + else if (!strcasecmp (cs_in, UTF8_STR)) { if (!strcasecmp (cs_out, "UTF-16LE") || !strcasecmp (cs_out, "UCS-2LE")) { char *target = out; ConversionResult result = ConvertUTF8toUTF16 ((const UTF8**)&in, (const UTF8*)(in + inlen), (UTF16**)&target, (UTF16*)(out + outlen), strictConversion); |