develooper Front page | perl.i18n | Postings from May 2007

Re: Character Encoding (UTF-8) in PERL

Thread Previous | Thread Next
From:
Christian Kuelker
Date:
May 10, 2007 03:28
Subject:
Re: Character Encoding (UTF-8) in PERL
Message ID:
4642F3B8.6@cipworx.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Oliver K├Ânig schrieb:
> Sarge
> ====
> mysql 4.0.24 
> 
> Etch
> ====
> 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=
=LB2m
-----END PGP SIGNATURE-----

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About