Differences between libiconv and glibc transcoding

Source: Internet
Author: User
The difference between libiconv and glibc is the same article. I prefer iconv function for transcoding, while mb_convert_encoding function for backup.
The iconv information in the same article: phpinfo is as follows:
Iconv implementation "libiconv"
In this way, the iconv transcoding content is complete.
The phpinfo information of another machine is as follows:
Iconv implementation glibc
In this way, the iconv transcoding content is incomplete, even though the ignore parameter is enabled. Replace the mb_convert_encoding function with complete content.
How can this problem be solved? At least I can find a solution. which machine is equipped with glibc and which is equipped with libiconv. then I will make a judgment and choose different transcoding functions?


Reply to discussion (solution)

It is estimated that you are under * nix

Reference
Http://rd.189works.com/article-38990-1.html

In the end, it is a problem with the code table. if necessary, you can do it yourself.

It is estimated that you are under * nix

Reference
Http://rd.189works.com/article-38990-1.html

In the end, it is a problem with the code table. if necessary, you can do it yourself.

I have also said that using the mb_convert_encoding function will definitely solve this problem. The key is that you have to determine when to use the mb_convert_encoding function first and when to use the iconv function first. The iconv function is preferred because of high efficiency, besides, mb_convert_encoding has some defects.

Reference the reply from snmr_com on the first floor: It is estimated that you are under * nix

Reference
Http://rd.189works.com/article-38990-1.html

In the end, it is a problem with the code table. if necessary, you can do it yourself.

I have also said that using the mb_convert_encoding function will definitely solve this problem. The key is that you have to determine when to use the mb_convert_encoding function and when to use the iconv function ......

According to that method, it is estimated that the operating system is to be determined. for linux, mb_convert_encoding is used first, and for Windows, iconv is used first. But is this a perfect solution?

Glibc is the libc library released by gnu, that is, the c runtime library. Glibc is the most underlying api in linux, and almost any other runtime library depends on glibc. Glibc not only encapsulates the system services provided by the linux operating system, but also provides implementation of many other necessary functional services. Glibc covers almost all of the Common UNIX standards. Like other UNIX systems, the archive groups contained in them are scattered in the tree directory structure of the system. like a bracket, the entire operating system is supported. In the GNU/Linux system, the development history of its C-function library highlights several important milestones in the evolution of GNU/Linux. glibc is used as the C-function library of the system, it is an important milestone in the evolution of GNU/Linux.

Libiconv history
For historical reasons, international texts often use different encodings for language or country reasons. With the advent of the Internet era, text communication over the Internet is also increasing: browsing foreign websites, character encoding conversion is particularly important at this time. This brings about a problem, that is, many characters are not included in a certain encoding method. To solve this confusion, the Unicode encoding method is established. Unicode is a super encoding that contains all these Encoding character sets. Therefore, some new text formats, such as XML, use Unicode as the default encoding method.
However, many older computers are still using traditional local character encoding methods. Some programs, such as email programs and browsers, must be able to convert between these different user codes. Some other programs support Unicode in order to smoothly support international processing, but there is still a need for conversion between Unicode and other traditional encoding. GNU libiconv is the code conversion library designed for these two applications.

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.