Metaflac UTF-8 fixes (Windows)

Metaflac can now print all console supported characters from tags on the
screen. It also fixes metaflac to be able to import its own exports back
without non-ascii characters getting mutilated. And --no-utf8-convert
now works properly with import and export commands.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
This commit is contained in:
Janne Hyvärinen
2013-04-25 08:58:08 +10:00
committed by Erik de Castro Lopo
parent f6585b0bdc
commit cc9f392166
4 changed files with 16 additions and 7 deletions

View File

@@ -203,7 +203,7 @@ int utf8_decode(const char *from, char **to)
return -1;
}
chars = WideCharToMultiByte(GetConsoleCP(), WC_COMPOSITECHECK, unicode,
chars = WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, unicode,
-1, NULL, 0, NULL, NULL);
if(chars < 0) /* underflow check */
@@ -224,7 +224,7 @@ int utf8_decode(const char *from, char **to)
return -1;
}
err = WideCharToMultiByte(GetConsoleCP(), WC_COMPOSITECHECK, unicode,
err = WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, unicode,
-1, *to, chars, NULL, NULL);
if(err != chars)
{