Database transcoding Solutions

Source: Internet
Author: User
Database transcoding
Before in the database to write the data did not execute mysql_query ("SET NAMES UTF8"), cause my database of Chinese is garbled, browse is can normal display, ask there is no way to convert the database garbled, converted to UTF8?

------Solution--------------------
read out in one way (without set names), transcode if necessary, and finally deposited in another way (plus set names).

------Solution--------------------
Library/table character set to use UTF
And then take a look at it, really not, just use the program to insert it, build a new library
------Solution--------------------
http://www.discuz.net/forum.php?mod=viewthread&tid=650717

http://www.baidu.com/s?wd=mysql+%CA%FD%BE%DD%BF%E2%D7%AA%C2%EB&rsv_bp=0&rsv_spt=3&inputT=9929
------Solution--------------------
In the output data with PHP function Iconv ("gb2312", "UTF-8", $str) to convert the string is OK.
------Solution--------------------
Export the database to a. sql file and rewrite it with Iconv ("gb2312", "UTF-8", $str) to import the new. SQL that will be generated.
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.