WIN32: Fix conversion of multibyte encodings.
This commit is contained in:
parent
41d3a70c58
commit
4edf35e414
1 changed files with 2 additions and 2 deletions
|
@ -419,7 +419,7 @@ char *OSystem_Win32::convertEncoding(const char* to, const char *from, const cha
|
|||
}
|
||||
|
||||
WCHAR *tmpStr;
|
||||
if (Common::String(from).equalsIgnoreCase("utf-16")) {
|
||||
if (Common::String(from).hasPrefixIgnoreCase("utf-16")) {
|
||||
// Allocate space for string and 2 ending zeros
|
||||
tmpStr = (WCHAR *) calloc(sizeof(char), length + 2);
|
||||
if (!tmpStr) {
|
||||
|
@ -431,7 +431,7 @@ char *OSystem_Win32::convertEncoding(const char* to, const char *from, const cha
|
|||
tmpStr = Win32::ansiToUnicode(string, Win32::getCodePageId(from));
|
||||
}
|
||||
|
||||
if (Common::String(to).equalsIgnoreCase("utf-16"))
|
||||
if (Common::String(to).hasPrefixIgnoreCase("utf-16"))
|
||||
return (char *) tmpStr;
|
||||
else {
|
||||
result = Win32::unicodeToAnsi(tmpStr, Win32::getCodePageId(to));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue