Bug #11971 Hebrew Encoding not pulling up via ASP code
Submitted: 15 Jul 2005 15:29 Modified: 29 Jul 2005 8:15
Reporter: Alon Solell Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.7nt and 4.1.13 OS:Windows (Windows 2003 Server Standard)
Assigned to: CPU Architecture:Any

[15 Jul 2005 15:29] Alon Solell
Description:
I'm semi-confused about this:

I can view in phpMyAdmin the data fine. Hebrew is showing up with no problems.
I use the MySQL-Front and I see Hebrew with no problem.
However, when I try to retireve the data via an ASP with ODBC connection, it brings question marks ????? ????? instead of hebrew text.

This code works fine when it is connected to an Access.mdb file.

We are in the process of migrating from ms-access.mdb into mysql.
So importing into the mysql server worked fine,. and I can view the data with phpMyAdmin with no problem.
My only problem is when trying to retrieve the same data via the same code that worked earlier with the access.mdb file.

Any pointers? suggestions?

mysql version 4.1.7nt

-Alon.
alon@wsco.com

How to repeat:
The process was outlined in the problem area.
[17 Jul 2005 0:23] Alon Solell
Hi again,

Here is a snapshot of a code that I'm using to retrieve the data from my database.

It is pulling up with just question marks that looks like:  ????? ?????

<%
 session.codepage = 1255

 DBType = "mysql"

 'MySQL ODBC Connection String
 datasourcename = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=localhost;DATABASE=alons_test1; USER=alon; PASSWORD=123; OPTION=3;"
	
 cursortype = 3

 Set DataConn = Server.CreateObject("ADODB.Connection")
 DataConn.Open datasourcename
 Set cmdTemp = Server.CreateObject("ADODB.Command")
 Set rs_main = Server.CreateObject("ADODB.Recordset")

 Sub ExecuteSQL(QueryText, cursortype, recordsetname)
	'-------------------------------------------
	'THE TWO LINES BELOW ARE FOR DEBUGGING
	'UNCOMMENT THEM IF QUERIES ARE FAILING
	'-------------------------------------------
	Response.Write(QueryText&"<br><br>")
	'On Error Resume Next
	cmdTemp.CommandText = QueryText
	cmdTemp.CommandType = 1
	Set cmdTemp.ActiveConnection = DataConn
	If DBType = "mysql" Then recordsetname.CursorLocation = 3
	recordsetname.Open cmdTemp, , 1, cursortype
 End Sub

 theQuery = "SELECT HEADER_homepage_heading FROM tblSystemHeaders"
 Call ExecuteSQL(theQuery, CursorType, RS_Main)

 
'-----------------------------------------------------------
'-----------------------------------------------------------
if not RS_Main.eof then
CAT_heading = rs_main("HEADER_homepage_heading")
end if
rs_main.close
%>	
<html>
<title>Hello Alon's World</title>
<body>
<TABLE ALIGN=CENTER BORDER=0 CELLSPACING=10 CELLPADDING=0 WIDTH=100%CLASS="mednormal">
<TR>
	<TD>
	<%=CAT_heading%><BR>
</TD>

</TABLE>
</body>
</html>

I've also included the definition of the table:

-- phpMyAdmin SQL Dump
-- version 2.6.0-pl3
-- http://www.phpmyadmin.net
-- 
-- Host: localhost
-- Generation Time: Jul 17, 2005 at 03:18 AM
-- Server version: 4.1.7
-- PHP Version: 4.3.10
-- 
-- Database: `alon_test1`
-- 

-- --------------------------------------------------------

-- 
-- Table structure for table `tblsystemheaders`
-- 

CREATE TABLE `tblsystemheaders` (
  `HEADER_id` int(10) NOT NULL auto_increment,
  `HEADER_regdate` datetime default NULL,
  `HEADER_newsbox_heading` varchar(200) default NULL,
  `HEADER_newsbox_text` longtext,
  `HEADER_homepage_heading` varchar(200) default NULL,
  `HEADER_homepage_text` longtext,
  `HEADER_faq_heading` varchar(200) default NULL,
  `HEADER_faq_text` longtext,
  `HEADER_contactus_heading` varchar(200) default NULL,
  `HEADER_contactus_text` longtext,
  PRIMARY KEY  (`HEADER_id`),
  UNIQUE KEY `infopage_id` (`HEADER_id`)
) ENGINE=InnoDB DEFAULT CHARSET=hebrew AUTO_INCREMENT=2 ;

NOTE:  English letters pull up fine with no problems at all.
It is specifically a problem with Hebrew chars.

my.ini has the following in it:

[MySQLD]
port=3306
basedir=C:\\Program Files\\SWsoft\\Plesk\\Databases\\MySQL
datadir=C:\\Program Files\\SWsoft\\Plesk\\Databases\\MySQL\\Data
default-character-set=hebrew
default-collation=hebrew_general_ci
default-storage-engine=INNODB
query_cache_size=8M
table_cache=32
tmp_table_size=7M
thread_cache=32
myisam_max_sort_file_size=100G
myisam_max_extra_sort_file_size=100G
myisam_sort_buffer_size=2M
key_buffer_size=2M
read_buffer_size=1M
read_rnd_buffer_size=256K
sort_buffer_size=256K
innodb_additional_mem_pool_size=2M
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=1M
innodb_buffer_pool_size=16M
innodb_log_file_size=10M
innodb_thread_concurrency=8
max_connections=300
key_buffer=4M
max_allowed_packet=1M
sort_buffer=256K
net_buffer_length=4K
old_passwords=1
[client]
port=3306

Does this help to analyze the problem?

Thanks,

-Alon.
[19 Jul 2005 8:07] Vasily Kishkin
Could you please attach to "Files" the table "tblsystemheaders" with some rows ?
I have some problem to input hebrew characters.
[19 Jul 2005 9:58] Alon Solell
mysql dump of Table structure with Insert statement

Attachment: tblsystemheaders.sql (application/octet-stream, text), 7.99 KiB.

[19 Jul 2005 10:03] Alon Solell
I've uploaded a mysql phpMyAdmin dump that has a table structure and Insert with a Hebrew Text.

Please advise.

Thanks,

-Alon.
[20 Jul 2005 7:14] Vasily Kishkin
Tested on Win 2003, MySQL server 4.1.13, MyODBC 3.51.11, IIS 6.0
[20 Jul 2005 7:14] Vasily Kishkin
ASP test case

Attachment: default.asp (application/octet-stream, text), 1.46 KiB.

[20 Jul 2005 7:32] Alon Solell
Can you provide me with link to actually see the hebrew pulling up?
Please use the very same code of ASP I've put into the ticket.
Did you make any changes to the my.ini file?
Can you post or email me your my.ini file so that I'll have matching environments?

You can email me to : alon@wsco.com

thanks!

-Alon
[20 Jul 2005 14:13] Alon Solell
MySQL server 4.1.13, MyODBC 3.51.11

I only get to see 4.1.12a and as far as MyODBC, I get an error about "Administrator has limited access to this service". So I'm not sure how to install an upgrade to the MyODBC. How do I actually verify the installed version?

-Alon.
[21 Jul 2005 18:14] Alon Solell
This code has been tested and works flawlessly in version 4.0.25.
This code DOES NOT WORK in 4.1.7nt
I now installed 4.1.13 and still,... the ASP code pulls only ???? question marks.
If you managed to see Hebrew using the ASP code,. please let me see  your my.ini file settings as well as the database dump so that I can attempt to replicate on my server.
Also, how did you load up the data?
What page encoding did you use? did you use phpMyAdmin?
When I used 4.0.25,. BEFORE UPLOADING, if my page was NOT on Windows-1255, it came as jibrish. 
So,. page encoding for uploading the data was very important in 4.0.25

Thanks,

-Alon.
[23 Jul 2005 8:01] Vasily Kishkin
I tested the query on VB and result was retruned right. I would like to say that is not bug of ODBC or server. Could you please check your IIS options ?
[23 Jul 2005 11:54] Alon Solell
Hello Vasily Kishkin

I tested the query on VB and result was retruned right. I would like to
say that is not bug of ODBC or server. Could you please check your IIS
options ?

What settings would I need to check in the IIS?
It is pulling up fine with 4.0.25.
I have 2 instances on my box right now.
One on port 3306 with versioni 4.1.13 which yields the question marks, and the Second instance is running on port 3325 with version 4.0.25 and is pulling
the correct hebrew text/chars.
Is there a special tweak of settings that I need to set in the IIS for version 4.1.x?
Email me and I'll give you remote access login info.

-Alon
alon@wsco.com
[29 Jul 2005 8:15] Vasily Kishkin
Sorry...I can't help you with IIS. Probably you need to look for some information on microsoft.com.