Storing and outputting Polish chars with MySql v5.0 and ASP

Storing and outputting Polish chars with MySql v5.0 and ASP

am 27.06.2006 21:19:25 von Larry Neylon

Hi there,

I'm currently trying to implement a website that will store and retrieve
Polish, so I need to be able to handle Polish characters using classic ASP
with MySql5.

Does anybody have an experience of doing this as I'm banging my head against
a brick wall getting this to work using either utf8 or latin2. I can't
believe I'm the first person in the world to want to do this! I've input
Polish characters directly into the database and the database is storing
them correctly, but when I write them out to the webpage I'm just getting ?s
for the Polish characters.

My setup is:

MySQL 5.0.18nt
MyODBC 03.51.11
IIS 6.0

The database variables are :

| character_set_client | utf8
|
| character_set_connection | utf8
|
| character_set_database | latin2
|
| character_set_results | utf8
|
| character_set_server | latin1
|
| character_set_system | utf8
|
| collation_connection | utf8_general_ci
|
| collation_database | latin2_general_ci
|
| collation_server | latin1_swedish_ci

The table has the Character Set as Latin2 and the varchar and text fields
are also Character Set Latin2.

My ASP Code is:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="28592"%>
<%
Response.Charset="ISO-8859-2"
%>
"http://www.w3.org/TR/html4/loose.dtd">



Test ADO Connection


<%
objConn.Open "Driver={MySQL ODBC 3.51 Driver}; Server=servername;
Port=3307; Option=16387; Stmt=SET NAMES 'latin2'; Database=evol_latin2;
Uid=user; Pwd=;"
objConn.Execute "SET NAMES 'latin2'"
objConn.Execute "SET CHARACTER SET 'latin2'"
objRs.Open "SELECT * FROM utf8_test", objConn, 1
For Each Field In objRs.Fields
Response.Write("Field '" & Field.Name & "' has value '" & Field.Value &
"
")
Next
%>

I've tried all the above with the database and asp code set to utf8 and am
having the same problems.

Any suggestions would be much appreciated.

Kind Regards,
Larry.