5 messages in com.mysql.lists.javaRe: Question about useUnicode, encodi...
FromSent OnAttachments
Christopher Taylor19 Dec 2002 17:46 
Mark Matthews19 Dec 2002 19:26 
Christopher Taylor19 Dec 2002 20:09 
Mark Matthews19 Dec 2002 20:25 
Christopher Taylor19 Dec 2002 21:33 
Subject:Re: Question about useUnicode, encoding detection, and Japanese windows
From:Christopher Taylor (csta@nanshu.com)
Date:12/19/2002 09:33:07 PM
List:com.mysql.lists.java

Hi Mark,

Yes, I'm using characterEncoding="latin1" and useUnicode="true", that's how I force it to work.

All you need to do is run MySQL 4.0.5 on Windows 2000 or Windows XP, but they must be Japanese versions of the O/S.

I'm pretty busy today and tomorrow, but Sunday I'll take a look at this with the debugger and see what I can find out for you.

-Chris

P.S. I've also taken a stab at improving the com.mysql.jdbc.jdbc2.optional.MysqlDataSource class so you can set all of the preferences directly on the datasource object (i.e. setCharacterEncoding ( ), setConnectTimeout ( ), setUseSSL() ). When it's finished I'll send it to you.

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Christopher Taylor wrote:

[snip]

- Database runs in latin1 mode - Client machine (using Connector/J) running a Japanese variant of

Windows

2000 or XP (we found the same problem on both) - Client makes a request to the server - Connector/J complains that it can't find a column with a particular

name

Same code running on English version of Windows 2000: no problems.

I did some more investigating, and found that if I forced Connector/J

to

use

"latin1" as its encoding, everything worked great.

So as far as I understand it, this is a bug in Connector/J's automatic encoding/decoding detection logic. I have plenty of Japanese Windows machines to play with, so if you need help testing, please let me know.

Exactly which version? This should be fixed in 3.0.3.

I'm using 3.0.3.

Okay, are you forcing the encoding when it doesn't work (i.e. using 'useUnicode' or 'characterEncoding=foo')?

I've tested this on my side by setting 'file.encoding' to 'SJIS' when starting my JVM, and I still don't see this problem. That doesn't mean it doesn't exist, but I'll either need enough details to be able to duplicate it on my machine, or have you run the code in a debugger, and step-through the driver, starting at com.mysql.jdbc.ResultSet.findColumn() and see what encoding Field.getName() is using...putting a breakpoint in Field.getStringFromBytes() might help there.

Or as a last resort, I can send you a driver that's littered with System.out.println(), but I don't like to do that when there is access to a debugger.

-Mark

- -- MySQL 2003 Users Conference -> http://www.mysql.com/events/uc2003/

For technical support contracts, visit https://order.mysql.com/?ref=mmma

iD8DBQE+ApvatvXNTca6JD8RAjCfAJ0SdhwW5oqVtFhvfu4ngqyd+4aCYwCdGEaJ OeA7snadXepE+LtGpjO3nmw= =q2Se -----END PGP SIGNATURE-----