(Original) Judgment string is GB2312?

xiaoxiao2021-03-06  39

For GB2312, the first-character code bits range from 0 × 81 to 0 × Fe, the tail character and the codes bits are 0 × 40 to 0 × FE, respectively, respectively, so:

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;}}} returni ISGB2312 ;

}

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

New Post(0)