可以怎么实现呢?

解决方案 »

  1.   

    逐个判断每个字符的ASC码是否大于128。
      

  2.   

    GBK范围:
    1st byte    2nd byte
    0x81~0xfe   0x40~0x7e and 0x80~0xfeBIG5范围:
    1st byte    2nd byte
    0x81~0xfe   0x40~0x7e and 0xa1~0xfe
    ______________
    从头开始判断. 非UNICODE时.
      

  3.   

    关于字符判断(GB 2312-80, Big-5, Shift-JIS, KS C-5601-1987)
    简体中文:
    字符集:GB 2312-80
    代码页:CP 936
    Lead byte:0xA1 - 0xFE
    Trail byte:0xA1 - 0xFE繁体中文:
    字符集:BIG-5
    代码页:CP 950
    Lead byte:0x81 - 0xFE
    Trail byte:0x40 - 0x7E, 0xA1 - 0xFE日文:
    字符集:Shift-JIS(Japan Industry Standard)
    代码页:CP 932
    Lead byte:0x81 - 0x9E, 0xE0 - 0xFC
    Trail byte:0x40 - 0xfc (except 0x7F)韩文(Wansung):
    字符集:KS C-5601-1987
    代码页:CP 949
    Lead byte:0x81 - 0xFE
    Trail byte:0x41 - 0x5A, 0x61 - 0x7A, 0x81 - 0xFE还有相关的API函数请到http://msdn.microsoft.com查阅
      

  4.   

    GBK范围:
    1st byte    2nd byte
    0x81~0xfe   0x40~0x7e and 0x80~0xfeif(char[0]>='\x081'&&char[0]<='\x0fe'&&( (char[1]>='\x040'&&char[0]<='\x07e') || (char[1]>='\x080'&&char[0]<='\x0fe') ) )
    {//汉字
    }
      

  5.   

    BOOL IsDBCSLeadByte(
      BYTE TestChar   // character to test
    );
    If the byte is potentially a lead byte, it returns a nonzero value.
    If the byte is not a lead byte, the return value is zero. 
      

  6.   

    IsDBCSLeadByte()
    无法检测汉字.它无法正确区分第一字节和第二字节(第一字节和第二字节有重复部分).
      

  7.   

    everandforever(forever):我也谢谢你了。