in reply to Re: Re: Re: unicode file in mysql
in thread unicode file in mysql

Thank you for your help, but this module is not installed on my ISP'server.... :-(
Do you know a method to do the same thing without using this module ?

Replies are listed 'Best First'.
Re: Re: unicode file in mysql
by mirod (Canon) on Aug 21, 2001 at 19:50 UTC

    Warning: cargo-cult programming ahead! This code is from XML::TiePYX, it works except when the strings come from a recent version of XML::Parser.

    You can probably try this:

    sub utf2latin1 { my $text=shift; $text=~ s{([\xc0-\xc3])(.)}{ my $hi = ord($1); my $lo = ord($2); chr((($hi & 0x03) <<6) | ($lo & 0x3F)) }ge; return $text; }