PDA

View Full Version : Conversion between UTF-8 and Unicode



alphilli
May 8th, 2007, 12:52 AM
In an application written in C++ I need to be able to convert text from Unicode to UTF-8 and from UTF-8 to Unicode.

Are there any built-in functions to do those conversions on a Linux platform?

cwaldbieser
May 9th, 2007, 12:13 PM
In an application written in C++ I need to be able to convert text from Unicode to UTF-8 and from UTF-8 to Unicode.

Are there any built-in functions to do those conversions on a Linux platform?

UTF-8 is an encoding of Unicode. Are you trying to convert to another encoding? If so, which one? UTF-16? UTF-32?

alphilli
May 9th, 2007, 07:31 PM
I need to convert between UTF-32 and UTF-8.

I know that they are both Unicode encodings but they are totally different representations of Unicode.

cwaldbieser
May 10th, 2007, 12:33 PM
I need to convert between UTF-32 and UTF-8.

I know that they are both Unicode encodings but they are totally different representations of Unicode.
Try "iconv". It is in the repositories. There are also libiconv libraries ($ apt-cache search iconv).
http://www.gnu.org/software/libiconv/