ifsnop / mysqldump-php

PHP version of mysqldump cli that comes with MySQL
https://github.com/ifsnop/mysqldump-php
GNU General Public License v3.0
1.25k stars 300 forks source link

Text file Encoding #76

Closed seahindeniz closed 9 years ago

seahindeniz commented 9 years ago

Hi, earlier I told u about the utf8mb4 character set problem and you solved. This time, when I run the codes using this

$dump = new Mysqldump( $dbname, $dbuser, $dbpass,$dbhost."",'mysql',array('single-transaction' => false,'compress' => 'BZIP2','default-character-set' => Mysqldump::UTF8MB4));
$dump->start('ydk/'.time().'.sql');

And the file saved fine.

But somethings not right.

If I run the codes and db>table>field has '🐈', file saved as ANSI encoding and the cat looked like 🐈 If field has not the '🐈' file saved as UTF8 without BOM

Thank you for solving the problems

ifsnop commented 9 years ago

There is no problem with encoding of utf8mb4 characters.

Since v1.5, you need to add the extension to the filename, so if you want to compress with bz2, you will need to to:

$dump->start('ydk/'.time().'sql.bz2');
seahindeniz commented 9 years ago

My point is not the utf8mb4, is text file encoding. ekran alintisi

ifsnop commented 9 years ago

Sorry, I misunderstood you. Since mysqldump-php doesn't write any header to the output file, may I suggest you to try another text editor, one with an option to select utf8 encoding? Looks like your editor is wrongly guessing the file encoding and that some utf8 bytes are confusing it. El 06/02/2015 20:32, "traBolic" notifications@github.com escribió:

My point is not the utf8mb4, is text file encoding. [image: ekran alintisi] https://cloud.githubusercontent.com/assets/5789670/6086065/9b002f7c-ae47-11e4-9a93-4c5483ab300b.PNG

Reply to this email directly or view it on GitHub https://github.com/ifsnop/mysqldump-php/issues/76#issuecomment-73298156.