Similar code on the network can only be used in gb2312 encoding. The following code can convert Chinese characters to PinYin in UTF-8 encoding.
The code and usage are as follows:
Copy codeThe Code is as follows: Function Pinyin ($ _ String, $ _ Code = 'gb2312 ')
{
$ _ DataKey = "a | ai | an | ang | ao | ba | bai | ban | bang | bao | bei | ben | beng | bi | bian |
PHP Chinese character to pinyin UTF8 version. The following is a code snippet :? Php (as the mainstream development language) **************************************** * *********************************** Pinyin. php (as the mainstream development
The following is a code snippet:
/*************************************** ******************************
FristPinyin: This function is used to convert the first Chinese character of a Chinese string into a pinyin letter (for example, "Chinese"-> Z)Copy codeThe Code is as follows:Create function 'fristpinin' (P_NAME VARCHAR (255) RETURNS varchar (255) CHARSET utf8BEGINDECLARE V_RETURN VARCHAR (255 );SET V_RETURN = ELT (INT
Add Pinyin4j-2.5.0.jar (included in the attachment, remember to unzip) to the Classpath.Tool class Pinyinutils code see below:packagecom.test.utils;importnet.sourceforge.pinyin4j.pinyinhelper;import net.sourceforge.pinyin4j.format.hanyupinyincasetype;import net.sourceforge.pinyin4j.format.hanyupinyinoutputformat;import net.sourceforge.pinyin4j.format.hanyupinyintonetype;import net.sourceforge.pinyin4j.format.exception.badhanyupinyinoutputformatcombination;publicclass pinyinutils{/*** to determin
Python to convert Chinese characters into Pinyin implementation program article a concise dry Chinese character to Pinyin program, copy download can be directly used, the students need to refer to the next.#coding: Utf-8#基于python2.6Table = ' a,-20319;ai,-20317;an,-20304;ang,-20295;ao,-20292;ba,-20283;bai,-20265;ban,-20
/*Boolean cfstringtransform (Cfmutablestringref string, Cfrange *range, Cfstringref transform, Boolean reverse); where The string argument is a string to be converted, such as the Chinese to convert, and it is mutable , it is also used as the final converted string. Range is the range to be converted, and the range of changes after the transformation is output, and if null, is considered a full conversion. Transform can specify what conversion to ma
You can use pinyin4j. jar to convert Chinese characters to pinyin. The Code is as follows:
Package mainapp; You can search for "pinyin4j. Jar" from the "resource channel" of csdn to find related resources and introduce them to the project.Pinyin4j can obtain pinyin corresponding to Chinese characters, and its format c
The use of Win8.1 system users know that the system comes with the Microsoft Pinyin Input method in the input will be a Chinese-English toggle button appears next to the input position, how to hide it?
When we edit the text content on the Web page or on the computer, the cursor position will appear a Microsoft Pinyin input method in the hover
I have previously written a Chinese character conversion using SQL stored procedures and triggers. Address: http://www.cnblogs.com/Capricornus/archive/2010/02/08/1665783.html
In fact, this can also be done in C.
Code
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> /// /// Abbreviation for converting Chinese characters to
JQuery. hz2Py. the conversion of Chinese characters to PinYin implemented by the js plug-in is a very practical online Conversion Function. This plug-in has packaged Chinese characters into a plug-in library, and the call time is very simple, only one method can be called to convert Chinese characters into
JQuery. hz2Py. the conversion of Chinese characters to pinyin implemented by the js plug-in is a very practical online conversion function. this plug-in has packaged Chinese characters into a plug-in library, and the call time is very simple, only one method can be called to convert Chinese characters into
Yesterday in the conversion pinyin found a bug, there are many words can not be converted, but also can not blame him, after all, People's Coucay 8k, should only be used.Helpless on the Internet to find the next, found an article "the most full of php Chinese pinyin function (a total of 25961 characters, including 20,902 basic
-(NSString *) Chinesetopinyin: (NSString *) chinese{cfstringref Hanzi=(__bridge cfstringref) (Chinese); Cfmutablestringrefstring= Cfstringcreatemutablecopy (NULL,0, Hanzi); //boolean cfstringtransform (Cfmutablestringref string, Cfrange *range, Cfstringref transform, Boolean reverse); //string to be converted//range to convert, NULL for all//transform what to do about the conversion//Kcfstringtransformmanda
Php Chinese to pinyin can be converted to only the first letter, or utf8, gbk lt ;? Php *************************************** * *********************************** Pinyin. php * ------------------------------ * Date: php Chinese to pinyin can only be converted to the firs
Because mysql does not support Chinese, it is not difficult to sort Chinese by pinyin. Today we use the convert function to implement it, any encoding can be sorted in pinyin. For more information, see.
Add the "binary" attribute to a field that contains Chinese characters f
Description: A Java class used to take the first letter of Chinese pinyin, for example: The Chinese character "People's Republic of China" takes the Chinese pinyin first letter the result is ZHRMGHG.
The procedure is as follows:
Package GOV.MCA;
/*** Created by IntelliJ idea
Here we use the mssql Stored procedure to obtain the advanced processing method of the letter function of the Chinese character pinyin header. If you need it, you can refer to it. php and asp.net are not required here.
Here we use the mssql Stored procedure to obtain the advanced processing method of the letter function of the Chinese character
In the past, it was not easy to obtain Chinese Characters in pinyin. Many practices were to use the gb2312 code to obtain Chinese Characters in pinyin order, but there were few gb2312 character sets, many Chinese characters in the more comprehensive GBK encoding are not in t
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.