cormanaz has asked for the wisdom of the Perl Monks concerning the following question:
In both the existing source table and the newdb table, the column charset is set to cp1256 (which is windoze arabic). When I look at the data table in the source db with a viewer that will show that charset, it shows the arabic chars.my $sqlstatement = 'select name_arabic from data'; my $sth = $dbh->prepare($sqlstatement); my @row; my @cases; $sth->execute || die "Could not execute MySQL statement: $sqlstatement +"; while (@row=$sth->fetchrow_array) { push(@cases, [ @row ]); } $sth->finish(); for my $i (0..$#cases) { my $sqlstatement = 'insert into newdb.names (arabicname) values (? +)'; my $sth = $dbh->prepare($sqlstatement); $sth->execute($cases[$i][0]) || die "putsql could not execute MySQ +L statement: $sqlstatement"; $sth->finish(); }
After running the above code, when I look at newdb.names with the same viewer, it shows question marks substituted for the arabic chars.
So it would seem that in the course of reading and/or writing the data I am hosing up the char encoding somehow. Anyone know how I can straighten it out?
Thanks...Steve
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Trouble with Perl MySQL Arabic
by graff (Chancellor) on Aug 20, 2006 at 05:24 UTC | |
by rminner (Chaplain) on Aug 20, 2006 at 09:03 UTC | |
by cormanaz (Deacon) on Aug 20, 2006 at 21:22 UTC | |
by graff (Chancellor) on Aug 20, 2006 at 23:22 UTC | |
|
Re: Trouble with Perl MySQL Arabic
by blockcipher (Beadle) on Aug 21, 2006 at 14:15 UTC |