Writing wstring to UTF-16 txt

Jul 8, 2010 at 8:57am
For example, I have a wstring test = "Ü";

I want to save it as a .txt utf-16 encoding. Anyone can give me advice on what should I use? I've tried using _wfopen_s and fwrite to open and save, but all I could get was a utf-8 encoded .txt

Can anyone show me a really simple example of how to create/write a utf-16 file?
Last edited on Jul 8, 2010 at 9:00am
Jul 8, 2010 at 10:02am
Jul 9, 2010 at 12:34am
It doesn't work for chinese characters though ><
Jul 9, 2010 at 8:14am
Disch has written a good article on this sort of thing, but I can't find it. You'll have to search the site.

I dunno if this helps:
http://www.cplusplus.com/forum/unices/12995/#msg62451
Topic archived. No new replies allowed.