only AcceptUTF-8encoded, but ifPHPcompile-time enabled–enable-gd-jis-convoption, then the non-ASCIIcharacter(such as kanji, pinyin, Greek, and arrowsHead) will be treated asEUC-JPCoding(Phpinfothe Chinese and American names"SupportJISencoded Fonts"),thus causing garbled characters(since Western fonts do not have kana or kanji characters, they are generally shown as all squares). Although Imagettftext () do
other letter lowercase2.string.title ()Returns a string, with the first letter of the string capitalized, and the other letter lowercase3.string.swapcase ()Used to convert the uppercase and lowercase characters of a string, lower case letters to lower letters4.string.upper ()To capitalize all strings5.string.lower ()Convert all strings to lowercase#去除空格或者指定字符串1.string.strip ([string])Remove the string from the end of the string without a parameter and remove the space by default2.string.lstrip
Sometimes, there may be a need for something like this:For this effect, we can have a solution like this: Packagebys.utils;Importjava.io.UnsupportedEncodingException;/*** Created by Toutou on 2014/2/21*/ Public classChinesecharacterhelper {Static Final intGb_sp_diff = 160; //The starting location code for the different pronunciations of the Chinese national standard first Class Static Final int[] Secposvaluelist = {1601, 1637, 1833, 2078, 2274, 2302, 2433, 2594, 2787, 3106, 3212, 3472, 3635,
A lot of times when you write a Python program, you add such a line of code to your head.# Coding:utf-8Or is that so?# -*-coding:utf-8-*-Wait a minuteThis line of code means that the same encoding format is set to Utf-8The data stored in the computer is encoded in various ways, such as Unicode, Utf-8, GBK, etc.Under Windows System, the text file should be saved by default in the format GBKWhen you save a file in an encoded format, you should use the same encoding to parse the file, or it may app
text displays. The character set used for Chinese character display is mainly zhs16cgb231280,us7ascii,we8iso8859p1 and so on. Character sets need to exist not only on the server side, but also on the client. Server side, the character set is specified when Oracle is installed, and character set registration information is stored in the V$nls_parameters table of the Oracle database dictionary; The client, the character set is divided into two situations, one of which is the Sql*net 2.0 version,
OutputStreamWriter package SerThe Vletoutputstream class uses write (string) to output the Chinese character string. For Jsp,java application Server, you should be able to ensure that embedded kanji are correctly routed at this stage. D. This is the URL character encoding issue. If the value returned from browser is included in the Get/post method, the servlet will not be able to get the correct value for the Chinese character information. In Sun's
Analysis: The large text in Oracel cannot be inserted directly because Oracle will automatically convert CLOB to string, when the text byte exceeds 4000 bytes, the hint character is too long.Note: GBK encoding: A kanji account of two bytes . UTF-16 encoding: Usually Chinese characters account for two bytes,CJKV expand Area B, expand C , expand D area of Kanji to four bytes (Unicode for general characters Th
1, use JS to determine whether a string contains numbers, English letters, Chinese characters String str = "This is string "; 1> var a =/[0-9]/; var b = a.test (str ),//true, indicating a number 2> var a =/[a-z]/i; var b = a.test (str ),//true, indicating the English alphabet 3> var a = new RegExp (" [\\u4e00-\\u9fff]+ "," G "); var B = a.test (str) ;//true, description 4> var a =/[0-9a-z]/i; var b = a.test (str)//true, description have English letters or numbers 2, judgi
+ + and other general use this way
2.2. Character encoding and BinaryCharacter encoding: ASCII (early, English only)--->gb2312 (supports 7K multi-kanji)--->gbk18030 (supports 20K multi-kanji)--->GBK (supports 70K multi-kanji)--->unicode (Universal code, Support for all national characters)UTF-8: Variable long version Unicode, space-saving, character-o
": "Qián wǎ"
,
"礽": "Réng",
"膶": "Rùn", "芿": "Rèng", "蟘": "Tè", "貣": "Tè"
,
"Brew": "Niàng niàn niáng",
"醸": "Niàng",
"鋱" ":" Tè ",
" Terbium ":" Tè "
}
There are 7 Chinese characters that are in B but not in a:
{"
㘄": "Lēng", "
䉄": "Léng", "䬋": "Léng", "䮚": "Lèng", "䚏": "Lèng,lì,lìn", "㭁"
: "Réng",
"䖆": "Niàng"
}
So I merged the two on the basis of dictionary A, got the final dictionary file pinyin_dict_withtone.js, the file size is 122kb:
var pinyin_dict_w
...For example:I'm a sandal.echo Time ();The code above has code ...But because it exists in the comments ...does not output ...So this page doesn't have to be converted to UTF8 format ...Another example:echo "I am a sandal";This obviously has the Chinese character output ...You have to convert to UTF8 ...Of course, many programs now use template (language Pack) technology ...The program (Non-language pack file) does not see any characters for the output ...So we just need to turn the language
character,%5c%27 is not a Chinese character, still is \ '.So MySQL how to judge a character is not a kanji, according to GBK encoding, the first byte ASCII code is greater than 128, basically can be. For example, we do not need to%DF, with%A1 can also:%a1%5c He may not be a Chinese character, but will be considered by MySQL to be a wide character, can let the back of the%27 escape out.So I can construct an exp out, query the Administrator account pas
Label:Test under MySQL 5.1.5-alpha to the conclusionLatin1:1character=1byte, 1 kanji =2character,In other words, a field is defined as varchar (200), it can store 100 characters or 200 letters.This should be noted, especially when the field content is composed of letters and Chinese characters, as far as possible to assume that the field content is composed of Chinese characters, set the field length accordinglyUTF8:1character=3bytes, 1
A pre-knowledge1, character: The character is the smallest literal unit of abstraction. It has no fixed shape (possibly a glyph) and has no value. "A" is a character, "€" (a symbol of the general currency of Germany, France and many other European countries) is also a character. "China" is a two kanji character. The character represents only one symbol, without any meaning of the actual value.2, Character set: The character set is a collection of char
of data transmission.
Four. Character encoding classificationThe computer was invented by the Americans, the earliest characters encoded as ASCII, only the English alphanumeric and some special characters and the corresponding relationship between the numbers.ASCII uses 1 bytes (8-bit binary) to represent one characterUnicode commonly used 2 bytes (16-bit binary) represents a character, the uncommon Word needs 4 bytesIf all of our documents are in English, you can use Unicode more space th
, **kwargs)Batch setting values such as: Mset (k1= ' v1 ', k2= ' v2 ') or mget ({' K1 ': ' v1 ', ' K2 ': ' V2 '})Get (name)Get valueMget (keys, *args)Bulk gain such as: mget (' ylr ', ' Wupeiqi ') or r.mget ([' Ylr ', ' Wupeiqi '])Getset (name, value)Set a new value and get the original valueGetRange (key, start, end)# Get sub-sequence (get from Byte, non-character) # parameter: # Name,redis name # Start, start position (bytes) # end, end position (bytes) # For example
*****************************************/
/**************************************************************************************/
/**
* Check if a string of characters entered is a character * input: str String * Returns: TRUE or Flase;
True indicates that all characters do not contain kanji */function checkstr (str) {if (/[^\x00-\xff]/g.test (str)) {return false;
else {return true; }/** * Check that a string of characters entered contains
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.