perl-unicode

Re: encode_utf8,from_to don't work?

2003-04-07 01:30:05
On 6 Apr 2003, Tsirkin Evgeny wrote:

I have a script that should read a file ,parse it and then
insert some data from it to the database (I am using DBI).
While debuging i am printing the data to my terminal .
The files are cp862 encoded and i am trying to get the utf8
encoding for it.
the scrit looks something like this:
while(<FILE>){
$_=encode_utf8($_);

 encode_utf8($_) is equivalent to encode("utf8", $_). This function expect
utf8 string and produce octets.

 For cp862 => utf8 conversion use
 $_ = decode('cp862', $_);
or
 from_to($_, 'cp862', 'utf8');

print ;
}
Apperently i can't see nothing on my screen - that probably means
that the encoding is not doen (the terminal can't show cp862)
the same happens with from_to function.
what could be wrong?
I am using perl 5.8.0 under RH.
P.S. Using Text::Iconv module seems to work perlfect !


-- 
 best regards
  Ing. Roman Vasicek

 software developer
+----------------------------------------------------------------------------+
 PetaMem s.r.o., Ocelarska 1, 190 00 Praha 9 - Liben, Czech republic
 http://www.petamem.com/

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