perl-unicode

Re: UTF8 2 Latin1

2000-12-12 13:56:20
David Zochowski wrote:

Hallo!

I do not know how to convert utf8 to latin1. I have Convert::Scalar tried,
but it does not work for the 2bites chars (german chars).
Could you help me? Do you know any other way to do it?

Try this:

use Unicode::MapUTF8 qw(from_utf8 utf8_supported_charset);
if ( utf8_supported_charset($charset) ) {
  $str = from_utf8({ -string => $ustr, -charset => $charset });
}


Hope this helps.

ilia.

<Prev in Thread] Current Thread [Next in Thread>