Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

store polish characters mysql

I am trying to save characters like "ą", "ć", "ł" but they are saved in the database as question marks (I save them using phpMyAdmin).

The database and table's collation is utf8_bin.

like image 929
user197483 Avatar asked Dec 08 '22 19:12

user197483


2 Answers

Try changing the collation to:

utf8_unicode_ci 

or

utf8_polish_ci 

You can refer to: http://mysql.rjweb.org/doc.php/charcoll

Also you can TRY altering the specific column with:

ALTER TABLE tbl MODIFY COLUMN txt TEXT CHARACTER SET utf8
like image 93
Plamen Nikolov Avatar answered Dec 11 '22 10:12

Plamen Nikolov


I've searched a lot and finally, I got a solution with this:

ALTER TABLE tableName MODIFY COLUMN columnName VARCHAR(64) CHARACTER SET `binary`;

You can change VARCHAR(64) to match your needs. I hope this helps someone. Note that I did not only required to store Polish characters but French and Spanish ones as well. So the solutions above might work for just polish chars.

like image 40
Bouramas Avatar answered Dec 11 '22 12:12

Bouramas