[Israel.pm] Can't use Hebrew with perl on mysql 4.1

Issac Goldstand issac at perl.org.il
Tue Sep 27 08:58:59 PDT 2005

I was going to point out that Perl 5.8 keeps it strings in Unicode
(utf8, I believe).  To use this with MySQL, simply use utf8_general.  To
convert from ISO-8859-8 to utf8, try doing something like :

use Encode

open IN "iso-8859-8"
open OUT ">utf8"

while (<IN>) {print OUT $_};

You'll need to modify this a bit to work with DB queries but I'm in a
bit of a rush and although I didn't have time to work out the "complete"
solution, I wanted to get you moving in the right direction. 


PS - Public credit goes to Motke Keshet of Jerusalem.pm from whose
latest presentation I copied the above Encode example.

Rami Addady wrote:

> Just updrade form DBD 2.9004 to 3.0002. but still have the same problem.
> When using mysql with hebrew charset: php and shaell work fine pert not.
> When using mysql utf8 charset: perl allso work fine.
> The point is that all my data in hebrew charset and I did't find easy
> way to convert it to utf8.
> Rami
> Gábor Szabó wrote:
>> On 9/27/05, Rami Addady <rami at active.co.il> wrote:
>>> Only from perl I can't work properly on Hebrew data. Perl application
>>> can't display the Hebrew text or insert proper Hebrew.  DBI module
>>> fetch
>>> ????? values  and insert  nulls instade of hebrew charcater to/from
>>> the DB.
>> I encountered similar problem with recent versions of DBD::Mysql,
>> I think 2.9004 or around that was working correctly.
>> I did not have the time and interest then to analyze it further and
>> unfortunatelly
>> I don't recall the exact version number.
>> Gabor
>> _______________________________________________
>> Perl mailing list
>> Perl at perl.org.il
>> http://perl.org.il/mailman/listinfo/perl
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://perl.org.il/mailman/listinfo/perl

More information about the Perl mailing list