T
Timothy Madden
Hello
I would like to export data from my application to CSV (comma separated
values) in Unicode because I have Asian characters in my text, but
wofstream writes all basic characters in plain ASCII !
That is until it reaches an extended character than I get an exception
(I set badbit to throw exceptions).
I use Visual Studio 2008 but I would like to use the standard C++
library for this task (and all other tasks).
By searching Google I could see I should explicitly define a null
conversion for my wide-character stream and then imbue it on my
wofstream but the code sample was quite large and when I used it my
application crashed.
Why does this have to be so complicated ? Do I need to explicitly
define this null conversion ? Do I need to define all those conversion
methods and know about locale and facets to write the file in UTF-16 ?
Is there no easy way in the standard for this ?
How can I write binary data to the wofstream ? I tried myFile.write()
but that takes a wofstream::char_type * pointer and still undergoes
the damn conversion that narrows the characters and throws on extended
ones...
Thank you,
Timothy Madden
I would like to export data from my application to CSV (comma separated
values) in Unicode because I have Asian characters in my text, but
wofstream writes all basic characters in plain ASCII !
That is until it reaches an extended character than I get an exception
(I set badbit to throw exceptions).
I use Visual Studio 2008 but I would like to use the standard C++
library for this task (and all other tasks).
By searching Google I could see I should explicitly define a null
conversion for my wide-character stream and then imbue it on my
wofstream but the code sample was quite large and when I used it my
application crashed.
Why does this have to be so complicated ? Do I need to explicitly
define this null conversion ? Do I need to define all those conversion
methods and know about locale and facets to write the file in UTF-16 ?
Is there no easy way in the standard for this ?
How can I write binary data to the wofstream ? I tried myFile.write()
but that takes a wofstream::char_type * pointer and still undergoes
the damn conversion that narrows the characters and throws on extended
ones...
Thank you,
Timothy Madden