[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Wanted: Script to convert to/from UTF-8/UTF-16/UTF-32

Siegfried Heintze

8/31/2008 12:23:00 AM

Does someone have a little ruby script that will read a file in
UTF-8/UTF-16/UTF-32 (my choice) and search for all the characters between
0x7f-0xffffff and convert them to an ASCII digit string that begins with
"&#" and ends with ";" and output the whole thing? If not, could someone
tell me how to write one?

How about a script to do the inverse?

Thanks!
siegfried


1 Answer

Aníbal Rojas

8/31/2008 3:57:00 PM

0

Siegfried,

There is a wrapper library for the standard iconv that takes care of
this stuff:

http://www.ruby-doc.org/stdlib/libdoc/iconv/rdoc/...

Take a look at:

http://www.websideattractions.com/2007/10/24/ruby-script-to-convert-files-character...

Best regards,

--
Aníbal Rojas
http://hasmanydeve...
http://ruby...
http://anibal@rojas.com.ve

On Aug 30, 8:22 pm, "Siegfried Heintze" <siegfr...@heintze.com> wrote:
> Does someone have a little ruby script that will read a file in
> UTF-8/UTF-16/UTF-32 (my choice) and search for all the characters between
> 0x7f-0xffffff and convert them to an ASCII digit string that begins with
> "&#" and ends with ";" and output the whole thing? If not, could someone
> tell me how to write one?
>
> How about a script to do the inverse?
>
> Thanks!
> siegfried