Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Conversion between utf-8 and iso8859-1?

Reply
Thread Tools

Conversion between utf-8 and iso8859-1?

 
 
Hadmut Danisch
Guest
Posts: n/a
 
      02-13-2004
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

 
Reply With Quote
 
 
 
 
MikkelFJ
Guest
Posts: n/a
 
      02-14-2004

"Hadmut Danisch" <(E-Mail Removed)> skrev i en meddelelse
news:c0j99t$t9p$04$(E-Mail Removed)-online.com...
> 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


 
Reply With Quote
 
 
 
 
Aredridel
Guest
Posts: n/a
 
      02-14-2004
> > 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.


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


 
Reply With Quote
 
Carlos
Guest
Posts: n/a
 
      02-16-2004
> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PSD to XHTML Conversion Services and PSD to HTML CSS ConversionServices, PSD to Joomla, Drupal, Wordpress Conversion xhtml champs Python 0 06-21-2011 11:59 AM
PSD to XHTML Conversion Services and PSD to HTML CSS ConversionServices, PSD to Joomla, Drupal, Wordpress Conversion PSD to XHTML Conversion Services and PSD to HTML CSS Conversion Services, PSD to Joomla, Drupal, Wor VHDL 0 04-25-2011 06:43 AM
conversion operator and conversion ctor subramanian100in@yahoo.com, India C++ 2 09-15-2009 12:46 PM
Difference between bin and obj directories and difference between project references and dll references jakk ASP .Net 4 03-22-2005 09:23 PM
What's the difference between the 'd' and 'i' conversion character? ling C Programming 3 08-12-2003 08:07 PM



Advertisments