Unicode conversion problem(slovak characters)
-
Hi, I am writing an application, which required unicode conversion, but I am facing some problem with SLOVAK characters. For example, I face the problem for character ď , whose value is ď for conversion, I did the following: string strNum = "271"; wchar_t lpszUcode[1]; lpszUcode[0] = atoi(strNum.c_str()); int nCodePage = 1252; int iBuffLen = WideCharToMultiByte(nCodePage, NULL, lpszUcode, 1, NULL, 0, NULL, NULL); char* buffer = new char[iBuffLen + 1]; WideCharToMultiByte(nCodePage, NULL, lpszUcode, 1, buffer, iBuffLen, NULL, NULL); buffer[iBuffLen] = 0; string strRes = buffer; It returns with the value d rather than ď . can somene pl. sugeeset the solution for this. Regards Tough Time Never last, but Tough People do.
-
Hi, I am writing an application, which required unicode conversion, but I am facing some problem with SLOVAK characters. For example, I face the problem for character ď , whose value is ď for conversion, I did the following: string strNum = "271"; wchar_t lpszUcode[1]; lpszUcode[0] = atoi(strNum.c_str()); int nCodePage = 1252; int iBuffLen = WideCharToMultiByte(nCodePage, NULL, lpszUcode, 1, NULL, 0, NULL, NULL); char* buffer = new char[iBuffLen + 1]; WideCharToMultiByte(nCodePage, NULL, lpszUcode, 1, buffer, iBuffLen, NULL, NULL); buffer[iBuffLen] = 0; string strRes = buffer; It returns with the value d rather than ď . can somene pl. sugeeset the solution for this. Regards Tough Time Never last, but Tough People do.
Vineet Kumar wrote:
int nCodePage = 1252;
Code page 1252 doesn't contain that character, so it translates to the nearest equivalent that is in hte code page - which is "d".
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p