|
-
September 22nd, 2015, 07:02 AM
#9
Re: how to pass char* to wchar_t*
Hi codeplug,
I think I was doing it totally wrong because I was receiving the buffer and decoding it with a function (My boss told me to use that function because it should work fine and I can't use another) so I use teh DecodeString() function which gaves me the char* I said before: "$ EuroÃ$" and then I was trying to pass that char* to the wchar_t* with the mbtowsc() function...
Please correct me if I'm wrong but I think that I have to use that mbtowsc to decode it, the buffer, and not to pass the char to wchar... am I in the right way now?
Now what I did is take the DecodeString() and copy it (to do the same) but instead of the memcpy() I use that mbtowsc function. Then, when I decode instead of getting "$ EuroÃ$", I get "$ Euro" and nothing more, not 'ñ' and not '$' any idea of why? (If I'm on the right way now ofc). And the length is ok because if I decode the length+1 for example there is a SIGSEGV
Thank you so much
Last edited by roseicollis; September 22nd, 2015 at 07:05 AM.
Tags for this Thread
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
|