On Fri, 12 Apr 2002, Vasilis Vasaitis wrote:
> On Thu, Apr 11, 2002 at 12:04:18AM -0700, Pedro Ferreira wrote:
> > Now I would like to do the oposite, convert an utf-8
> > file to an ascii file, each utf-8 character would be
> > encoded back to U+nnnn. Many thanks in advance for any

>   Just like in the case of the opposite conversion, this conversion can also
> be easily achieved with an one-liner. The following seems to be able to do
> the job:
> 
>   perl -ne 'for (unpack "U*", $_) { printf $_ > 255 ? "U+%04X" : "%c", $_ }'

 Unless you regard ISO-8859-1 as a synonym to US-ASCII, '255' has to
be '127' :-) 

--
Linux-UTF8:   i18n of Linux on all levels
Archive:      http://mail.nl.linux.org/linux-utf8/

Reply via email to