Code to convert Unicode files among different formats

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
User avatar
dejudicibus
Knows some wx things
Knows some wx things
Posts: 32
Joined: Mon Dec 20, 2004 10:28 am
Location: Rome, Italy (EU)
Contact:

Code to convert Unicode files among different formats

Post by dejudicibus »

Have anybody developed code to convert files from UTF-16 or UTF-32 to UTF-8, and vice versa?
User avatar
Ryan Norton
wxWorld Domination!
wxWorld Domination!
Posts: 1319
Joined: Mon Aug 30, 2004 6:01 pm

Re: Code to convert Unicode files among different formats

Post 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
[Mostly retired moderator, still check in to clean up some stuff]
User avatar
dejudicibus
Knows some wx things
Knows some wx things
Posts: 32
Joined: Mon Dec 20, 2004 10:28 am
Location: Rome, Italy (EU)
Contact:

Re: Code to convert Unicode files among different formats

Post 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.
mitch
Earned a small fee
Earned a small fee
Posts: 16
Joined: Wed Sep 15, 2004 1:04 pm

Post 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
Avi
Super wx Problem Solver
Super wx Problem Solver
Posts: 398
Joined: Mon Aug 30, 2004 9:27 pm
Location: Tel-Aviv, Israel

Post 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)
Post Reply