Professional Web Applications Themes

Conversion between utf-8 and iso8859-1? - Ruby

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...

  1. #1

    Default Conversion between utf-8 and iso8859-1?

    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

    Hadmut Guest

  2. #2

    Default Re: Conversion between utf-8 and iso8859-1?


    "Hadmut Danisch" <de> skrev i en meddelelse
    news:c0j99t$t9p$04$t-online.com... 

    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


    MikkelFJ Guest

  3. #3

    Default Re: Conversion between utf-8 and iso8859-1?

    > > 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.[/ref]

    iconv sounds like the tool to me.
     

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

    Ari


    Aredridel Guest

  4. #4

    Default Re: Conversion between utf-8 and iso8859-1?

    > Hi, 

    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



    Carlos Guest

Similar Threads

  1. PDF to XML conversion
    By kalpanaganeshm@gmail.com in forum Adobe Acrobat SDK
    Replies: 0
    Last Post: August 29th, 09:00 AM
  2. iso8859-1 and utf-8
    By polo in forum ASP.NET Web Services
    Replies: 4
    Last Post: January 3rd, 11:58 AM
  3. UTF-8 -> iso8859-15
    By Andreas Schwarz in forum Ruby
    Replies: 7
    Last Post: July 31st, 04:02 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139