[RESOLVED] How to read a UNICODE string into char buffer
Hi all,
I want to read a UNICODE string into a char buffer. So I do the following.
Code:
std::string temp = GetAsString();
std::cout << temp << std::endl;
char buff[256] = {0};
int val = sprintf(buff, "%s", temp.c_str());
GetAsString() method return a UNICODE string. That's mean there is a zero/null after each character, so in sprintf() it terminate after finding the null. So only first character is added to the buffer. How can I fix it.
Thanks
Re: How to read a UNICODE string into char buffer
http://www.google.com/search?hl=en&q...te&btnG=Search
You are going to need to convert it from unicode to ascii because I don't think console supports unicode. (It might, Not sure)
Re: How to read a UNICODE string into char buffer
Thanks for the replay. I solve the problem