タグ

ブックマーク / nowsmartsoft.or.tv (1)

  • UTFCP

    /* サンプルの目的上、記述上の高速化は施してありませんので、 書き方を工夫すると今より多少高速化できる可能性があります。 */ unsigned int getUTFCP( unsigned char const **pptr ) { unsigned int ucs4; unsigned char const *ptr = *pptr; if ( *ptr <= 0x7f ) { //(1) A ucs4 = *ptr++; } else if ( *ptr <= 0xf9 ) { //B if ( ptr[1] <= 0xf9 ) { //(2) BB unsigned char b1 = ptr[0] - 0x80; unsigned char b0 = ptr[1] - 0x80; ucs4 = utfcp2ucs4[ b1 * 122 + b

  • 1