Bug #19177 mysqldump incorrect characters.
Submitted: 18 Apr 2006 20:37 Modified: 20 Apr 2006 0:48
Reporter: orhan sevki Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: mysqldump Command-line Client Severity:S3 (Non-critical)
Version:4.1.11-log OS:Linux (debian)
Assigned to: CPU Architecture:Any

[18 Apr 2006 20:37] orhan sevki
Description:
Dear Sir,

We having problem, when i get mysqldump for my backups.. turkish characters showing incorrect.

example:

mysqldump -u dbusername -p databasename > path/to/backup.sql

after, we opened this backup .sql file via notepad or any text editor, turkish characters showing incorrect.

like:

'ı' showing: ı
'ö' showing: ö
'ü' showing: ü
'ş' showing: ÅŸ

etc..

Also i see top of the sql file this line: /*!40101 SET NAMES utf8 */;   (this line changes, when we use --default-character-set option)

but, when we get the backup via this command, characters showing fine:

mysqldump --default-character-set=latin5 -u dbusername -p databasename > path/to/backup.sql

top of the sql file line changes now: /*!40101 SET NAMES latin5 */;

Why we need to use default-character-set= option? is this really need?

I posted this bug, because system all character sets and collations: latin5 and latin5_turkish_ci, but still dump backups incorrect.. if you not use default-character-set.

Also, our database, tables and collations uses: latin5 and latin5_turkish_ci

If we still backup our database this command, backups are fine? ;

mysqldump -u dbusername -p databasename > path/to/backup.sql

but, characters showing incorrect ? also we need to use option --default-character-set for restore database? I'm totally confused.

I posted your forums but no any response received.

if i'm incorrect, Can you please explain me? which backups ok or not.

Best Regards,

Orhan Sevki.

How to repeat:
sorry i dont know enough english, i hope understand us. thanks.
[19 Apr 2006 8:43] Valeriy Kravchuk
Thank you for a problem report. This is not a bug, but a documented behaviour of mysqldump (http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html):

"--default-character-set=charset_name

Use charset_name as the default character set. See Section 5.11.1, “The Character Set Used for Data and Sorting”. If not specified, mysqldump uses utf8."

Useful information can be also found in http://dev.mysql.com/doc/refman/5.0/en/character-sets.html.

Please, send a links to forum threads where you asked that questions. I'll try to get somebodies attention to them.
[20 Apr 2006 0:48] orhan sevki
Thank you, here is the my question:

http://forums.mysql.com/read.php?28,83402,83402#msg-83402

Shortly; our database and tables using: latin5 charset and collations: latin5_turkish_ci

how can we get correct backup for this charset and restore correctly. If you explain me, i'm pretty happy.