简体   繁体   中英

sql server unicode data migrating to mysql database

I am migrating a site which was using sql server database to a php/mysql script. I have a table posts with a field data type ntext. This field is holding a lot of unicode data. Now when I migrated this data to mysql table, it got spoiled. When php ui display this data, it shows as ?????. When I see it in phpmyadmin, data looks alright. Can someone help me what should be the field type and Collation. At the moment. The field type is mediumtext and Collation is utf8mb4_unicode_ci.

You can see a http://phpfoxdev.ramtajogi.com/index.php?do=/post/13050/??????%20:%20???%20???%20????%20????%20????%20?????%20/mod_3/

The actual text is ਹਰ ਰਾਤ ਤੇਰੀ ਯਾਦ ਸੀਨੇ ਨਾਲ ਸੋਂ ਜਾਂਦੇ ਹਾ, ਰਬ ਦੇ ਵਾਂਗੂ... which is an indian language script.

Help will be appreciated.

Regards Parminder

Check HTTP responses encoding, if you output UTF-8 but HTTP headers say that it's ISO-8859-1 everything seems broken.

Check mysql default encoding http://dev.mysql.com/doc/refman/5.5/en/charset-configuration.html

or if you cannot manage the server or fear that you brake something change connection setting in PHP http://www.php.net/manual/en/mysqlinfo.concepts.charset.php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM