Bug #39107 Problems displaying hebrew under utf8
Submitted: 28 Aug 2008 21:04 Modified: 29 Aug 2008 8:00
Reporter: alon gfsfd Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:5.0.51a OS:Windows (2003 server web edition)
Assigned to: CPU Architecture:Any
Tags: hebrew, utf8

[28 Aug 2008 21:04] alon gfsfd
Description:
the following was tested under mysql 5.0.51a and myodbc 5.01.04

my databse is set to utf8_general_ci.

i was inputting information in hebrew to a varchar field using the myodbc specified above (from asp).

when i try to retrieve it, i get the information in gibrish.

some more info:
all of my mysql variables are set to utf8
all of my asp variables are set to utf8

if entered a 10 chars word in hebrew and when i do SELECT length(fieldName)
on it, i get 19.

so i assume it was encoded to utf8 successfully.

How to repeat:
1. create a db, table, and varchar field under utf8_general_ci
2. input hebrew data using asp and myodbc 5.01.04
3. read the data using asp
[28 Aug 2008 21:38] alon gfsfd
important info:

this only happens when i input the data using ADO Command (with parameters)

if i input the data using the connection iteself like this:
cn1.execute "INSERT INTO tags (TagName) VALUE ('שלום')"

then it works fine

so to replicate, input the date (step 2) with ado command
[28 Aug 2008 21:39] alon gfsfd
date = data
[29 Aug 2008 6:26] Tonci Grgin
Hi Alon and thanks for your report.

From what I see there should be no problem if:
  o) You used correct script header (<%@ CodePage=65001 Language=... and session.CodePage = 65001... and Response.CharSet = "utf-8")
  o) You used latest version of c/ODBC 5.1

If you meet both prerequisites, please attach my.ini/my.cnf file used to start MySQL server and ASP script.
[29 Aug 2008 6:59] alon gfsfd
Thank you for your reply,

I was able to solve this problem by creating the parameter with adVarWChar Datatype instead of adVarchar.

Is it ok to work like this?
[29 Aug 2008 8:00] Tonci Grgin
Alon, of course! "W" are unicode functions and you should use them in situations like these. And you should use c/ODBC 5.1 for the same reason.

Closing the report now. Thanks for your interest in MySQL.