MySQL, Perl and HTML
am 14.09.2006 17:17:17 von andipfaffHi there,
I am fighting with my MysQL database in order to get french and
cyrillic characters properly displayed on my website. I've created
tables with latin1 charset. My Perl script on the webserver worked fine
until I have added Unicode support. I saved the script file in Unicode
UTF-8 format, and added
Content-type: text; charset=3Dutf-8/html\n\n
to print the HTML headers. Now I can display french _and_ cyrillic
characters, which are stored in strings inside the script.
Unfortunately the strings coming from my MySQL database via DBI are no
longer displayed properly on the website. Characters like
=E9 (é) are displayed as chinese or so.
I was reading many postings and I tried many things like
encode:decode("utf8", $string) in my Perl script and "SELECT
CONVERT(data USING utf8) AS data1 FROM test;" to select data from the
database, but still I'm not able to solve the problem.
I found out that the strings inside my script are UTF-8 coded, but the
string I get from the tables are not.
Can anybody help getting this thing working?
Thanks in advance
Andi Pfaff