Develop and Download Open Source Software

Browse Subversion Repository

Diff of /trunk/teraterm/teraterm/vtterm.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3445 by doda, Sun Jun 7 07:22:05 2009 UTC revision 3446 by doda, Sun Jun 7 08:39:00 2009 UTC
# Line 3161  BOOL ParseFirstUTF8(BYTE b, int hfsplus_ Line 3161  BOOL ParseFirstUTF8(BYTE b, int hfsplus_
3161                  }                  }
3162          }          }
3163    
3164            buf[count++] = b;
3165          if (count < 2) {          if (count < 2) {
                 buf[count++] = b;  
3166                  return TRUE;                  return TRUE;
3167          }          }
3168    
3169          memset(mbchar, 0, sizeof(mbchar));          memset(mbchar, 0, sizeof(mbchar));
3170    
3171          // 2バイトコードの場合          // 2バイトコードの場合
3172          if ((buf[0] & 0xe0) == 0xc0 &&          if ((buf[0] & 0xe0) == 0xc0) {
3173                  (buf[1] & 0xc0) == 0x80) {                  if ((buf[1] & 0xc0) == 0x80) {
   
                 if (hfsplus_mode == 1 && maybe_hfsplus == 1) {  
                         UnicodeToCP932(first_code);  
                         maybe_hfsplus = 0;  
                 }  
3174    
3175                  code = ((buf[0] & 0x1f) << 6);                          if (hfsplus_mode == 1 && maybe_hfsplus == 1) {
3176                  code |= ((buf[1] & 0x3f));                                  UnicodeToCP932(first_code);
3177                                    maybe_hfsplus = 0;
3178                            }
3179    
3180                  UnicodeToCP932(code);                          code = ((buf[0] & 0x1f) << 6);
3181                            code |= ((buf[1] & 0x3f));
3182    
3183                  // 次のバイトがASCIIならそのまま表示 (2006.6.30 yutaka)                          UnicodeToCP932(code);
                 if ((b & 0x80) != 0x80) { // ASCII(0x00-0x7f)  
                         ParseASCII(b);  
                         count = 0;  // reset counter  
   
                 } else {  
                         // ASCIIでないのなら、マルチバイト文字の始まりと見なす。  
                         buf[0] = b;  
                         count = 1;  
3184                  }                  }
3185                    else {
3186                            ParseASCII(buf[0]);
3187                            ParseASCII(buf[1]);
3188                    }
3189                    count = 0;
3190                  return TRUE;                  return TRUE;
3191          }          }
3192    
3193          buf[count++] = b;          if (count < 3) {
3194                    return TRUE;
3195            }
3196    
3197          if ((buf[0] & 0xe0) == 0xe0 &&          if ((buf[0] & 0xe0) == 0xe0 &&
3198                  (buf[1] & 0xc0) == 0x80 &&                  (buf[1] & 0xc0) == 0x80 &&

Legend:
Removed from v.3445  
changed lines
  Added in v.3446

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26