|
-
Sep 29th, 2008, 03:51 AM
#1
Thread Starter
PowerPoster
[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
“victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha
-
Sep 29th, 2008, 04:25 PM
#2
Frenzied Member
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)
-
Oct 12th, 2008, 09:28 PM
#3
Thread Starter
PowerPoster
Re: How to read a UNICODE string into char buffer
Thanks for the replay. I solve the problem
“victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|