Php UTF-8 encoding solution: 10 methods

Source: Internet
Author: User
Php UTF-8 encoding solution: 10 methods

  1. [Mysql]
  2. Default-character-set = utf8
  3. [Mysqld]
  4. Default-character-set = utf8
  5. Default-storage-engine = myisam
  6. Add the following under [mysqld:
  7. Default-collation = utf8_bin
  8. Init_connect = 'set names utf8'

7. add

  1. Mb_internal_encoding ('utf-8 ');

8. add the last side of create table:

  1. Engine = myisam default charset = utf8 collate = utf8_bin

9. phpmyadmin/config. inc. php

  1. $ Cfg ['defaultcharset'] = 'utf-8 ';
  2. $ Cfg ['recodingengine '] = 'iconv ';

10. when phpadmin exports data, remove the "binary display in hexadecimal format" check box.

Note: file system functions do not support UTF-8! It is said that php6 has built-in unicode support and can be tested.

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.