Unicode Strings
-
Hi, My C++ program (VS2005) has two parts. one part writes into a file and the other part reads from it. The folder name is japanese. eg: C:\Documents and Settings\管理者 To read the file in this location,I am supposed to use an API (third party library) which takes the file location as a char*. I have the file location(C:\Documents and Settings\管理者) in a CString. How do I convert this into a char* ? I tried using the T2A macros, but the japanese string is not getting extracted. the char* pointer shows some junk charaters. Any inputs on this ? Thanks in advance.
-
Hi, My C++ program (VS2005) has two parts. one part writes into a file and the other part reads from it. The folder name is japanese. eg: C:\Documents and Settings\管理者 To read the file in this location,I am supposed to use an API (third party library) which takes the file location as a char*. I have the file location(C:\Documents and Settings\管理者) in a CString. How do I convert this into a char* ? I tried using the T2A macros, but the japanese string is not getting extracted. the char* pointer shows some junk charaters. Any inputs on this ? Thanks in advance.
It's better to seek the help of 3rd party library to provide Unicode interfaces. Other workarounds like renaming to ASCII and restoring it back after use will be painful.
-Sarath. "Great hopes make everything great possible" - Benjamin Franklin
My blog - Sharing My Thoughts
-
It's better to seek the help of 3rd party library to provide Unicode interfaces. Other workarounds like renaming to ASCII and restoring it back after use will be painful.
-Sarath. "Great hopes make everything great possible" - Benjamin Franklin
My blog - Sharing My Thoughts
I m not sure but check if this helps you, CString buf = _T("salut"); //the first string char * Result; //the result long len = wcslen (buf); //the length of "salut" wcstombs (Result,buf,len); //conversion to char * Result[len] = '\0';