PHP Chinese encoding collection class library-PHP source code

Source: Internet
Author: User
Ec (2); currently, this class library can be implemented. It can be converted to simplified Chinese & lt;-& gt; traditional Chinese encoding interchange, simplified Chinese and Traditional Chinese-& gt; pinyin one-way conversion, simplified Chinese, traditional Chinese & lt;-& gt; UTF8 encoding conversion, simplified Chinese, traditional Chinese-& gt; Unicode one-way conversion @ author Hessian (solarischan@21cn.com) @ version 1.5 @ Copyright All Rights Reserved HessianNETiS @ Use Authorization script ec (2); script

Currently, this class library can be used to convert Simplified Chinese <-> traditional Chinese encoding, simplified Chinese, traditional Chinese-> pinyin one-way conversion,
Simplified Chinese and Traditional Chinese <-> UTF8 encoding conversion, simplified Chinese and Traditional Chinese-> Unicode one-way conversion

@ Author Hessian (solarischan@21cn.com)
@ Version 1.5
@ Copyright Hessian/NETiS
@ Use authorized GPL (the Code cannot be used for any commercial purposes and can be modified without the consent of the author, but the modified Code must be published in accordance with the GPL Protocol)
@ Special thanks to unknow (simplified conversion code snippet)
@ 2001 1
@ Last modified
@ Access public

Update record

Ver 1.7
Modified the bug caused by the while loop. This bug will handle errors when the last character of the string is "0.
Affected Methods: CHStoUTF8 (), CHStoUNICODE ()

Ver 1.6
The constructor adds a parameter so that you can easily set the configuration file path when using it.

Ver 1.5
Added the UTF8 Conversion Function to GB2312 and BIG5.

Ver 1.4
Increase the value of charset When HTML is converted to true.

Ver 1.3
Added the function of converting traditional Chinese to pinyin.

Ver 1.2
Converts simplified and traditional Chinese characters to UTF8.
The function for converting Simplified Chinese to pinyin. the return value is changed to a string. the Pinyin of each Chinese character is separated by spaces.
Added the function of converting Simplified Chinese to UNICODE.
Added the function of converting traditional Chinese to UNICODE.

Ver 1.1
Added the OpenFile () function to support opening local files and remote files.
Added the function of converting Simplified Chinese to UTF8.
Added the function of converting traditional Chinese to UTF8.

Ver 1.0
A class library integrating simplified Chinese characters and traditional Chinese characters corresponding to various encoding interchange has been initially completed.

</

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.