NowPlayingPlugin: Minor tweaks.

This commit is contained in:
Birunthan Mohanathas
2011-09-08 12:42:03 +00:00
parent 6b06548260
commit d598c56b76
14 changed files with 47 additions and 67 deletions

View File

@ -257,7 +257,7 @@ void CInternet::DecodeReferences(std::wstring& str)
/*
** ConvertToWide
**
** Convert from multibyte ti wide string.
** Convert multibyte string to wide string.
**
*/
std::wstring CInternet::ConvertToWide(LPCSTR str, int codepage)
@ -266,15 +266,12 @@ std::wstring CInternet::ConvertToWide(LPCSTR str, int codepage)
if (str && *str)
{
int strLen = (int)strlen(str) + 1;
int strLen = (int)strlen(str);
int bufLen = MultiByteToWideChar(codepage, 0, str, strLen, NULL, 0);
if (bufLen > 0)
{
WCHAR* wideSz = new WCHAR[bufLen];
wideSz[0] = 0;
MultiByteToWideChar(codepage, 0, str, strLen, wideSz, bufLen);
szWide = wideSz;
delete [] wideSz;
szWide.resize(bufLen);
MultiByteToWideChar(codepage, 0, str, strLen, &szWide[0], bufLen);
}
}