The content of this article is introduced in PHP iconv function of the use of the method, here to share to you, the need for friends can refer to
Recently in a program, you need to use the ICONV function to fetch the UTF-8 encoded page into gb2312,
Convert php character encoding to gb2312 to utf8. In php, we usually use iconv and mb_convert_encoding for character encoding conversion. However, mb_convert_encoding has much worse conversion performance than iconv. Stringiconv (we usually use
Php determines the encoding of the input characters on the page. In the php Tutorial, how does one determine the encoding of the input characters on the page? Phpfunctionconvtoutf8 ($ str) {if (mb_detect_encoding ($ str, UTF-8, ISO-8859-1, gbk )!
Description of the differences between iconv and mb_convert_encoding in php conversion strings. For more information, see. Iconv-Convert string to requested character encoding (PHP 4> = 4.0.5, PHP 5)
Mb_convert_encoding-Convert character encoding
This article mainly introduces the PHP character encoding conversion method, the steps of the method is more detailed, hope can help everyone.
Iconv-convert string to requested character encoding (PHP 4 >= 4.0.5, PHP 5)
Mb_convert_encoding-convert
Iconv function Knowledge Summary in PHP, Phpiconv function Summary
Today, when revising the paper online, I met the Iconv function. Learn a bit
Header (' Content-type:application/vnd.ms-excel;charset=utf-8 '); $name =iconv (' utf-8 ', ' gb2312 ',
The iconv function library can convert character sets. It is an indispensable basic function library in PHP programming.
1. Download The libiconv function library http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.9.2.tar.gz;
2. Decompress tar-zxvf
Mb_convert_encoding is used to convert the encoding. I have never understood the concept of program encoding, but now it seems a bit open.
However, the English language generally does not have Encoding Problems. Only Chinese data can have this
HP to JS string with ecsape conversion added to the URL, and received with PHP, and then find the unscape function on the Internet to convert, so the string obtained is UTF-8, but what I need is gb2312, therefore, iconv conversion is used.
It
Iconv function Library can complete the conversion between various character sets, which is an indispensable basic function library in PHP programming.
1, download Libiconv function library http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.9.2.tar.gz;
2
That's how it started.
$str = Iconv (' UTF-8 ', ' GB2312 ', unescape (isset ($_get[' str ')) "$_get[' str ']:");
After the launch of a heap of such a mistake: Iconv (): detected an illegal character in input string
Considering the GB2312 character
But English does not usually have coding problems, only Chinese data will have this problem. For example, when you use Zend Studio or EditPlus to write the program, using the GBK code, if the data needs to enter the database, and the database code
That's how it started.
$str = Iconv (' UTF-8 ', ' GB2312 ', unescape (isset ($_get[' str ')) "$_get[' str ']:");
After the launch of a heap of such a mistake: Iconv (): detected an illegal character in input string
Considering the GB2312 character
The source of MySQL garbled is a problem with incorrect MySQL character set settings, this article summarizes the commands for viewing the MySQL character set. This includes viewing the MySQL database server character set, viewing the MySQL database
InnoDB a row lock is a table that has no index locked in the case of an index.Table lock Demo (no index)Session1:Mysql> set autocommit=0;Mysql> select * from Innodb_test;+------+-------------+| ID | name |+------+-------------+| 1 | Woshiceshi || 2 |
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.