Re: Character Encoding (UTF-8) in PERL
[email protected] ("James Kiser") Thu, 10 May 2007 09:48:54 -0700
| Newsgroups | perl.i18n,perl.i18n,perl.i18n |
|---|---|
| Message-ID | <[email protected]> |
Solving it on the database side would be the optimal solution. If it isn't a possibility, for whatever reason, take a look at http://perldoc.perl.org/utf8.html. Thanks, James On 5/10/07, Christian Kuelker <[email protected]> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi, > > Oliver K=F6nig schrieb: > > Sarge > > =3D=3D=3D=3D > > mysql 4.0.24 > > > > Etch > > =3D=3D=3D=3D > > mysql 5.0.32 > > > > In mysql everything looks fine, too: > I doubt .. > > > mysql> SHOW VARIABLES LIKE "character_set_%"; > > +--------------------------+----------------------------+ > > | Variable_name | Value | > > +--------------------------+----------------------------+ > > | character_set_client | utf8 | > > | character_set_connection | utf8 | > > | character_set_database | utf8 | > > | character_set_filesystem | binary | > > | character_set_results | utf8 | > > | character_set_server | utf8 | > > | character_set_system | utf8 | > > | character_sets_dir | /usr/share/mysql/charsets/ | > > +--------------------------+----------------------------+ > > > > However a PERL script with dbh->do(SHOW VARIABLES LIKE "character_set_%= "); > > returns: > > character_set_client latin1 > > character_set_connection latin1 > > character_set_database utf8 > > character_set_filesystem binary > > character_set_results latin1 > > character_set_server utf8 > > character_set_system utf8 > > character_sets_dir /usr/share/mysql/charsets/ > > > > How can we tell PERL to use UTF-8 as default encoding? > > As you show in your query, the results are in latin1. I would guess > it is the upgrade of mysql which is your problem. So try to solve the > problem in mysql not Perl. > > Cheers > C. > > > > > > > > > > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.6 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFGQvO3rKb2iXSP9HYRAtdhAKCnJHGJRe/+SbvVUyDJVBNegXg6rQCfTfn2 > opttpYX19epCeWfJMsGf0ZY=3D > =3DLB2m > -----END PGP SIGNATURE----- >