Topic: 请教:如何判断一个字符是否为中文

  Print this page

1.请教:如何判断一个字符是否为中文 Copy to clipboard
Posted by: ysheng
Posted on: 2004-03-22 22:53

谢谢
我想计算字符串里面有几个中文

2.Re:请教:如何判断一个字符是否为中文 [Re: ysheng] Copy to clipboard
Posted by: rostone
Posted on: 2004-03-23 22:12

记得好像大约似乎 判断字符的值(unicode?)大于某个值 为中文 反之为英文

3.Re:请教:如何判断一个字符是否为中文 [Re: ysheng] Copy to clipboard
Posted by: itemp
Posted on: 2004-03-25 13:09

ascii码>255

4.Re:请教:如何判断一个字符是否为中文 [Re: ysheng] Copy to clipboard
Posted by: sungo
Posted on: 2004-03-26 15:45

Use Regular Expression.

5.Re:请教:如何判断一个字符是否为中文 [Re: ysheng] Copy to clipboard
Posted by: smartsharp
Posted on: 2004-03-31 11:55

You should understand what kind of codes the Chinese words are
using first, maybe GBcode or UNIcode.

for GBcode, if the first byte value >= 0x80, then it's a Chinese word.
for Unicode, if the first byte value >= 0x80, then it's a Chinese word.

of course, there're many other encoding schema for Chinese words,
e.g. GBK, UTF-8 and etc..


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923