请问如何判断一个char字符是汉字的前半部还是后半部?

解决方案 »

  1.   

    The IsDBCSLeadByte function determines whether a character is a lead byte—that is, the first byte of a character in a double-byte character set (DBCS). BOOL IsDBCSLeadByte(
      BYTE TestChar   // character to test
    );
      

  2.   

    这个函数只能判断一个字符能不能是头字符,
    两字节内码:
    GBK范围:
    1st byte    2nd byte
    0x81~0xfe   0x40~0x7e and 0x80~0xfeBIG5范围:
    1st byte    2nd byte
    0x81~0xfe   0x40~0x7e and 0xa1~0xfe第一字符和第二字符有重复的部分,所以这个函数无法区分第一字符和第二字符.
    唯一查找的方法是,从一个你确定不是汉字的字符(小于0X40)开始查起.