X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fencoding.c;h=822e9f53659ec780d654c4f9168094a2d5b03bcc;hb=32844c59e618cfaf1999e81e32b5e18fcb13a5b9;hp=f5b978ab406465ac72722fccc8312fc1dbbdcf39;hpb=650997e4865a090b6856c7ca34b02f42994e8e29;p=wimlib diff --git a/src/encoding.c b/src/encoding.c index f5b978ab..822e9f53 100644 --- a/src/encoding.c +++ b/src/encoding.c @@ -254,7 +254,7 @@ DEFINE_CHAR_CONVERSION_FUNCTIONS(utf16le, "UTF-16LE", utf16lechar, /* tchar to UTF-8 and back */ #if TCHAR_IS_UTF16LE -DEFINE_CHAR_CONVERSION_FUNCTIONS(tstr, "UTF16-LE", tchar, +DEFINE_CHAR_CONVERSION_FUNCTIONS(tstr, "UTF-16LE", tchar, utf8, "UTF-8", char, false, in_nbytes * 2, @@ -264,7 +264,7 @@ DEFINE_CHAR_CONVERSION_FUNCTIONS(tstr, "UTF16-LE", tchar, static) DEFINE_CHAR_CONVERSION_FUNCTIONS(utf8, "UTF-8", char, - tstr, "UTF16-LE", tchar, + tstr, "UTF-16LE", tchar, false, in_nbytes * 2, WIMLIB_ERR_INVALID_UTF8_STRING, @@ -300,7 +300,8 @@ int tstr_to_utf8_simple(const tchar *tstr, char **out) { size_t out_nbytes; - return tstr_to_utf8(tstr, tstrlen(tstr), out, &out_nbytes); + return tstr_to_utf8(tstr, tstrlen(tstr) * sizeof(tchar), + out, &out_nbytes); } int