Bug #22791 Encoding is not handled properly in batch and script mode
Submitted: 28 Sep 2006 16:25 Modified: 23 Oct 2006 12:15
Reporter: Maciej Pilichowski Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S3 (Non-critical)
Version:1.2.3 beta OS:Linux (opensuse 10.0)
Assigned to: CPU Architecture:Any

[28 Sep 2006 16:25] Maciej Pilichowski
Description:
I set table to ISO-8859-2. Now, when I enter data like this (using KDE Konsole)
mysql < script.sql
I can only see "?" for each polish character.

Also when I load it to QB (as script) the data are displayed (query script window) correctly but when they are entered but I can only see "?" for each polish character.

The script is of course ISO-8859-2. I have no such problem and it should be read just fine.

Btw. when I copy&paste it to query window the data are entered ("insert into") ok. So this way it works, but due to other QB bugs for me is still a no-go.
It also works when I run mysql in interactive mode. Still I need a batch mode to run some complex queries often.

I can attach whole script if this would help.

Note, my locale is set to us_US but again -- it was no problem with any app.

How to repeat:
See above.

Suggested fix:
Assume the input is exactly the same encoding as the table is.Exactly like mysql interactive mode;
[30 Sep 2006 9:48] Maciej Pilichowski
PS. To correctly input data in latin2 (batch mode) I have to set table to * latin1 *. But of course the sorting does not work then.
[4 Oct 2006 14:56] Valeriy Kravchuk
Thank you for a problem report. What version of QB did you use?
[4 Oct 2006 17:21] Maciej Pilichowski
QB -> About -> 1.2.3beta.
[5 Oct 2006 10:06] Maciej Pilichowski
I see you changed the category&version, but please note that this report applies also to "mysql" console tool -- interactive vs. batch mode, as I described before.
[22 Oct 2006 11:44] Valeriy Kravchuk
As we suspect server/command line tools problem here, please, send the smallest script.sql file that demonstrate the behaviour described, with all CREATE DATABASE, CREATE TABLE and other statements to execute before that script. 

I am almost sure it is related to proper using of "set names ..." SQL-statement.
[23 Oct 2006 12:15] Maciej Pilichowski
I upgraded to 5.0.26 -- everything works fine now.