The program often makes full-width half-width judgments about characters or strings, such as full-width letters, numbers, punctuation marks, and so on. There are many ways to make the right judgments, but what I want to know is what the nature of these judgments is, which is the conclusion that the character is encoded or the length of the character stored in the computer is determined by the full-width or half-angle. Although the issue of literacy level, but very much want to have a clear understanding of the nature of such problems, please the heroes of the road to enlighten! Thank you!
The implementation of language is not limited, preferably Php,java or JS.
Reply content:
The program often makes full-width half-width judgments about characters or strings, such as full-width letters, numbers, punctuation marks, and so on. There are many ways to make the right judgments, but what I want to know is what the nature of these judgments is, which is the conclusion that the character is encoded or the length of the character stored in the computer is determined by the full-width or half-angle. Although the issue of literacy level, but very much want to have a clear understanding of the nature of such problems, please the heroes of the road to enlighten! Thank you!
The implementation of language is not limited, preferably Php,java or JS.
This is actually very good to understand, half-width of what is only the difference between the display, in the final analysis of the conversion is actually stored in the computer machine code (do not know is not called this) different Ah, different machine code corresponding to different characters. To make a difference PHP can be escaped into \xe2 format (I do not know this format is called God Horse. ==!), JS should also have a corresponding method of it.