pgloader icon indicating copy to clipboard operation
pgloader copied to clipboard

charset problems

Open piviul opened this issue 3 years ago • 3 comments

Good morning sirs, I would like to import a mysql database to postgres. The mysql db use latin1 as charset, postgres utf8. When I run pgloader mysql://myuser:mypwd@myserver/dbname postgresql://pguser:pgpwd@pgserver/dbname all seems to works but when I open one of the tables in postgres dbname I see that all the accented letters are transformed in hieroglyphics... What I wrong? I have tried to add in pgloader command the option --encoding latin1 to specify the encoding of the source but I continue to see hieroglyphics instead of accented letters... $ pgloader --version pgloader version "3.3.2" compiled with SBCL 1.3.14.debian

Thank you very much

Piviul

piviul avatar Mar 25 '22 08:03 piviul

You may want to have a look into: https://github.com/dimitri/pgloader/issues/665

Latin1 in mysql is actually cp1252 (see: https://dev.mysql.com/doc/refman/8.0/en/charset-mysql.html) You could try following: decoding table names matching ~/.*/ as CP1252

Chr3is avatar Jul 26 '22 08:07 Chr3is

@dimitri Is there a reason why CP1252 is not used by default for the conversion from mysql/mariadb when the tables are encoded with latin1 (which is actually cp1252)?

Chr3is avatar Jul 26 '22 08:07 Chr3is

I just wanted to leave a link to my comment on a similar issue #665 here in case it may help anyone running into this issue running the CCL compiled build as it doesn't support CP1252 encoding mentioned above.

TylerHorn avatar Sep 16 '22 22:09 TylerHorn