Coder Social home page Coder Social logo

utf8mb4 character problem about mysqldump-php HOT 8 CLOSED

ifsnop avatar ifsnop commented on August 27, 2024
utf8mb4 character problem

from mysqldump-php.

Comments (8)

ifsnop avatar ifsnop commented on August 27, 2024

Could you please create a dump with mysqldump, so i can reproduce the
problem?
El 31/01/2015 11:43, "traBolic" [email protected] escribió:

I tried to dump this character properly but it allways return ? ? ?
🎭
🎲
🐈
My friend, can show me hot to solve this problem?


Reply to this email directly or view it on GitHub
#73.

from mysqldump-php.

seahindeniz avatar seahindeniz commented on August 27, 2024

Of course http://tny.cz/d9db67e0

false)); $dump->start('ydk/'.time().'.sql'); ?>

from mysqldump-php.

ifsnop avatar ifsnop commented on August 27, 2024

Thanks, but I was expecting to see the output from the original mysqldump
(the one that comes with mysql binaries). I imagine that maybe is not
possible, so I will try to reproduce the values. However, if you could
provide it, that would be great and reduce fix time.
El 31/01/2015 13:35, "traBolic" [email protected] escribió:

Of course http://tny.cz/d9db67e0

Reply to this email directly or view it on GitHub
#73 (comment).

from mysqldump-php.

seahindeniz avatar seahindeniz commented on August 27, 2024

Ok this is the original mysqldump result http://tny.cz/b3b2ad7a

using with "mysqldump -u root bagislar2 > c:/mysql.sql"

from mysqldump-php.

seahindeniz avatar seahindeniz commented on August 27, 2024

This is utf8mb4 original mysqldump
http://tny.cz/6f9d4477

"mysqldump --default-character-set=utf8mb4 -u root bagislar2 > c:/mysql.sql"

from mysqldump-php.

seahindeniz avatar seahindeniz commented on August 27, 2024

Problem solved by deleting this line https://github.com/ifsnop/mysqldump-php/blob/master/src/Ifsnop/Mysqldump/Mysqldump.php#L181

First, I change this line to $this->dbHandler->exec("SET NAMES utf8mb4"); and it worked
after do that, i delete the line for good.

Also

I changed the https://github.com/ifsnop/mysqldump-php/blob/master/src/Ifsnop/Mysqldump/Mysqldump.php#L223

$this->compressManager->write($this->getDumpFileHeader());
to
$this->compressManager->write(chr(239).chr(187).chr(191) .$this->getDumpFileHeader());

However i cant create sql file without bom signature but it worked so far(i believe)

And I know, this is not a global solution :)

from mysqldump-php.

ifsnop avatar ifsnop commented on August 27, 2024

I have added a new option to the dumpSettings array. You could now specify character encoding when connecting, just like mysql/mysqldump does with "default-character-set". When using "utf8mb4", there will be support for the four byte utf8 character encoding.

There is a new test that ensures that utf8mb4 columns are correctly dumped.

Please test this fix, as it could depend in configuration settings from my.cnf (it tries not to do so)

pd.- Until mysql sets the default connection mode to utf8mb4, mysqldump-php will use utf8.

from mysqldump-php.

ifsnop avatar ifsnop commented on August 27, 2024

I prefer not to add the BOM signature since it is not needed for utf8 file reading, and won't fix the issue with database dumps.

from mysqldump-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.