mysql char set

mikecarquote

New member
Jul 6, 2008
224
1
0
127.0.0.1
Can anyone make suggestions? I have tried all I find in google but still cannot make it work:

I am trying to use phpmyadmin to import a bunch of data with extended characters, accents, into a mysql DB table. The char set of the table field is utf8. The data is in a txt file with properly formated insert statments. Myphpadmin truncates the text as soon as it enounters an extended character. Escaping the char does not seem to help. If I directly paste an extended char in the table field it works, but importing with phpmyadmin truncates. Any help!!

Thx!!
 


A few things to try:

Check into php's multibyte string functions- PHP: mb_convert_encoding - Manual

If your data is in a txt file with SQL statements (ie: SQL script), check the encoding on that file.

Pasting it into the field in PMA causes it to be treated differently, find out what it's doing to the string before binding it to a SQL statement.
 
every time I bump into this stuff I waste a lot of time on it

try with this:
make sure the file is utf8 (you can check it / change it with notepad++)
MySQL charset: UTF-8 Unicode (utf8)
MySQL connection collation utf8_unicode_ci
Table collation utf8_unicode_ci

I just copied these values from a working site with accetns and everything working correctly

other value to try if it doesn't work: latin_swedish_ci

I hope it helps
 
Jryan21 if i only knew about that fucking function before wasting countless hours. Thanks for posting it will come in very helpful for me.