Okay, sorted it.
For the C++ people (not this awful Perl stuff) the solution is:
Code:
--------------------
CString CSqueezeboxStatus::FromUTF8(LPBYTE pUTF8, int nSize)
{
#define MAX_CHAR 1
WCHAR wszResult[MAX_CHAR+1];
DWORD dwResult = MAX_CHAR;
CString cResult;
int iRes = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)pUTF8, nSize,
wszResult, dwResult);
if (iRes == 0)
{
DWORD dwErr = GetLastError();
printf("MultiByteToWideChar() failed - > %d\n", dwErr);
}
else
{
wszResult[iRes] = _T('\x00');
cResult = wszResult;
}
return cResult;
}
--------------------
Many thanks to the contributors to this thread who pointed me in the
right direction. This problem has nagged me for months!
Jim
--
jimwillsher
------------------------------------------------------------------------
jimwillsher's Profile: http://forums.slimdevices.com/member.php?userid=410
View this thread: http://forums.slimdevices.com/showthread.php?t=33029
_______________________________________________
discuss mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/discuss