How to use Java to verify a string is Chinese characters

xiaoxiao2021-03-06  36

For GB2312, the first-character code bits range from 0 × 81 to 0 × Fe, the tailmatal code bits are 0 × 40 to 0 × Fe Public Boolean ISGB2312 (String Str) {char [] Chars = Str.ToChararray ( ); Boolean ISGB2312 = false; for (int i = 0; i = 0x81 && INTS [0 ] <= 0xfE && INTS [1]> = 0x40 && INTS [1] <= 0xfe) {ISGB2312 = True; Break;}}} Return ISGB2312;

转载请注明原文地址:https://www.9cbs.com/read-69999.html

New Post(0)