PHP even MySQL with utf-8 code garbled how to do

Source: Internet
Author: User
Tags phpmyadmin

1. Modify My.ini:[mysql]default-character-set=utf8[mysqld]default-character-set=utf8default-storage-engine=myisam in [ MYSQLD] Next add: default-collation=utf8_bininit_connect= ' SET NAMES UTF8 '

2. In front of the PHP program that needs to do database operation plus mb_internal_encoding (' utf-8 ');

3.create table final Edge plus Engine=myisam DEFAULT Charset=utf8 collate=utf8_bin

4.phpmyadmin/config.inc.php

$cfg [' defaultcharset '] = ' utf-8 '; $cfg [' recodingengine '] = ' iconv ';

5.phpmyadmin/libraries/string.lib.php the mb_internal_encoding of line 41st ($GLOBALS [' CharSet ']) to: mb_internal_encoding (' Utf-8 ');

6.phpAdmin Check out the "binary area with hexadecimal display" when exporting data

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.