Page 1 of 1

Code to convert Unicode files among different formats

Posted: Mon Dec 20, 2004 10:59 am
by dejudicibus
Have anybody developed code to convert files from UTF-16 or UTF-32 to UTF-8, and vice versa?

Re: Code to convert Unicode files among different formats

Posted: Mon Dec 20, 2004 11:55 am
by Ryan Norton
dejudicibus wrote:Have anybody developed code to convert files from UTF-16 or UTF-32 to UTF-8, and vice versa?
See wx/strconv.h and wxMBConvXXX classes in the docs

they can't handle the BOMs in the files obvoisly, see here for the BOMs and convert accordingly -
http://www.microsoft.com/globaldev/getw ... icode.mspx

Re: Code to convert Unicode files among different formats

Posted: Mon Dec 20, 2004 12:09 pm
by dejudicibus
[quote="Ryan Norton"
See wx/strconv.h and wxMBConvXXX classes in the docs
[/quote]

I know those classes, Ryan, and I use them in my application. However I am not sure I am using them in the optimal way. It is very difficult to find Unicode expertize in wxWidgets community. Probably there are few Unicode applications around. What I am looking for are File classes based on wxMBConvXXX classes managing various aspects including BOM and file format recognition.

Posted: Mon Dec 20, 2004 6:31 pm
by mitch
Hi there. I know this isn't wx-specific, and it is a bit enormous, but have you looked at ICU (IBM's open-source library for i18n)? There's a lot of stuff in there, and it is C++ and portable.

http://oss.software.ibm.com/icu/

Later,
SDM

Posted: Mon Dec 20, 2004 7:26 pm
by Avi
In my newbie head there are two encodings: ANSI and Unicode. Both are handled by wxString. See? Don't I keep it simple :D :P (little joke, don't take me seriously)