bug 626180 - partial backout of bug 607121 (undo encoding-munging from changeset 3f8bee2e48a7) which broke non-ASCII plugin info. r+a=bsmedberg

This commit is contained in:
Jonathan Kew 2011-01-18 18:26:19 +00:00
Родитель a319e70923
Коммит 43ebc23403
1 изменённых файлов: 1 добавлений и 25 удалений

Просмотреть файл

@ -81,31 +81,7 @@ static char* GetKeyValue(void* verbuf, const WCHAR* key,
return nsnull;
}
// copy the WCHAR cp1252 output from VerQueryValueW into a
// byte buffer so that we can use MultiByteToWideChar on it
nsCString bstr;
for (UINT i = 0; i < blen; ++i) {
bstr.Append((char)buf[i]);
}
// determine number of Unicode character to be generated
int ulen = ::MultiByteToWideChar(codepage, MB_PRECOMPOSED,
bstr.BeginReading(), bstr.Length(),
nsnull, 0);
if (ulen == 0) {
return nsnull;
}
nsString ustr;
ustr.SetLength(ulen);
if (ustr.Length() < (unsigned)ulen) {
return nsnull;
}
(void)::MultiByteToWideChar(codepage, MB_PRECOMPOSED,
bstr.BeginReading(), bstr.Length(),
ustr.BeginWriting(), ustr.Length());
return PL_strdup(NS_ConvertUTF16toUTF8(ustr).get());
return PL_strdup(NS_ConvertUTF16toUTF8(buf, blen).get());
}
static char* GetVersion(void* verbuf)