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 » Mon Dec 20, 2004 10:59 am

Have anybody developed code to convert files from UTF-16 or UTF-32 to UTF-8, and vice versa?

User avatar
Ryan Norton
Moderator
Moderator
Posts: 1319
Joined: Mon Aug 30, 2004 6:01 pm

Re: Code to convert Unicode files among different formats

Post by Ryan Norton » Mon Dec 20, 2004 11:55 am

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 » Mon Dec 20, 2004 12:09 pm

[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 » Mon Dec 20, 2004 6:31 pm

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 » Mon Dec 20, 2004 7:26 pm

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