472,093 Members | 2,517 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,093 software developers and data experts.

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

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"
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-2">
<title>Test ADO Connection</title>
</head>
<body>
<%
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 &
"<br />")
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.
Jun 27 '06 #1
0 2281

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by dave | last post: by
6 posts views Thread by Juergen Gerner | last post: by
reply views Thread by Steffen Gebert | last post: by
9 posts views Thread by Ash Christopher | last post: by
20 posts views Thread by tigrfire | last post: by
2 posts views Thread by AmigoFd | last post: by
3 posts views Thread by Diwa | last post: by
4 posts views Thread by robert.szczepanski | last post: by
oll3i
reply views Thread by oll3i | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.