I said before that if the JS file is not UTF8, there will be bugs in IE, so the JS code must also use UTF-8. Databases must also use UTF-8.
php(as the current mainstream development language)Using UTF-8 to summarize:
- php(as the current mainstream development language)The file itself must be UTF-8 encoded. Unlike Java, which generates class files, this avoids this problem.
- php(as the current mainstream development language)To output the header: header("Content-Type: text/html; charset=UTF-8")
- The meta tag doesn’t matter, all browsers that have a header will parse it according to the header.
- All peripherals must use UTF8, including databases, *.js, *.css (CSS has little impact)
- php (as the current mainstream development language) itself is not Unicode. All functions such as substr must be changed to mb_substr (need to install the mbstring extension); or use iconv to transcode (basically Linux has been installed, if not, download, tar, make, make install, very simple)
- my.ini:
[MySQL(The best combination with PHP)]
default-character-set=utf8
[MySQL(With PHP) The best combination)d]
default-character-set=utf8
default-storage-engine=MyISAM
in [MySQL(The best combination with PHP)d] add:
default-collation=utf8_bin
init_connect=SET NAMES utf8
- Add mb_internal_encoding(utf-8) in front of the php (as the current mainstream development language)
program that needs to perform database operations;
- Add ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin at the end of create table
- php(as the current mainstream development language)MyAdmin/config.inc.php(as the current mainstream development language)
$cfg[DefaultCharset] = utf-8;
$cfg[RecodingEngine] = iconv;
- php(as the current mainstream development language)When Admin exports data
uncheck "Use hexadecimal display for binary areas"
Particularly frustrating: the file system function does not support UTF-8!
http://www.bkjia.com/PHPjc/509161.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/509161.htmlTechArticleI have said before that if the JS file is not UTF8, there will be bugs in IE, so the JS code must also use UTF-8. Databases must also use UTF-8. php (as the current mainstream development language) is summarized in UTF-8: ph...