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

Re: Character Encoding (UTF-8) in PERL

Thread Previous
From:
James Kiser
Date:
May 10, 2007 10:21
Subject:
Re: Character Encoding (UTF-8) in PERL
Message ID:
46f3dd090705100948l54677ebds8ca716735c32f96c@mail.gmail.com
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 <christian.kuelker@cipworx.org> wrote:
> -----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


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