Conversion between utf-8 and iso8859-1?

H

Hadmut Danisch

Hi,

I need to convert between different character sets,
but didn't find any library to do so except for
ruby-gnome's glib.convert

Is there any character conversion library which
doesn't come with a complete graphical library?

regards
Hadmut
 
M

MikkelFJ

Hadmut Danisch said:
Hi,

I need to convert between different character sets,
but didn't find any library to do so except for
ruby-gnome's glib.convert

Is there any character conversion library which
doesn't come with a complete graphical library?

I'm not aware of any but that isn't to say there isn't one :)
I assume you have checked out "iconv" which I have no experience with.

There is a good code page tutorial here - follow a few links if you need.

http://www.cs.tut.fi/~jkorpela/chars.html

The utf-8 format is easily decomposed into UCS2, and from there it is fairly
easy to go to 8859-1 because it is only 256 characters and most of them are
in the lower 8 bytes of UCS2.
You should btw. also consider 8859-9 (I think it is) it's basically 8859-1
with the euro sign.

Mikkel
 
A

Aredridel

I need to convert between different character sets,
I'm not aware of any but that isn't to say there isn't one :)
I assume you have checked out "iconv" which I have no experience with.

iconv sounds like the tool to me.
You should btw. also consider 8859-9 (I think it is) it's basically 8859-1
with the euro sign.

ISO-8859-15, which has updated french and German characters, and the
Euro. -9 is non-roman.

Ari
 
C

Carlos

Hi,
I need to convert between different character sets,
but didn't find any library to do so except for
ruby-gnome's glib.convert

Is there any character conversion library which
doesn't come with a complete graphical library?

Between these two encodings, you can use, without any external library:

utf8string.unpack("U*").pack("c*") # => latin1 string

latin1string.unpack("C*").pack("U*") # => utf8 string
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top