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 3443 by doda, Sun Jun 7 06:16:26 2009 UTC revision 3445 by doda, Sun Jun 7 07:22:05 2009 UTC
# Line 3069  int GetIndexOfHFSPlusFirstCode(unsigned Line 3069  int GetIndexOfHFSPlusFirstCode(unsigned
3069  }  }
3070    
3071    
3072  static void UnicodeToCP932(unsigned int code, int byte)  static void UnicodeToCP932(unsigned int code)
3073  {  {
3074          int ret;          int ret;
3075          char mbchar[32];          char mbchar[32];
# Line 3147  BOOL ParseFirstUTF8(BYTE b, int hfsplus_ Line 3147  BOOL ParseFirstUTF8(BYTE b, int hfsplus_
3147                  // 1バイト目がC1制御文字(0x80-0x9f)の場合も同様。                  // 1バイト目がC1制御文字(0x80-0x9f)の場合も同様。
3148                  if (count == 0 || count == 1) {                  if (count == 0 || count == 1) {
3149                          if (hfsplus_mode == 1 && maybe_hfsplus == 1) {                          if (hfsplus_mode == 1 && maybe_hfsplus == 1) {
3150                                  UnicodeToCP932(first_code, 3);                                  UnicodeToCP932(first_code);
3151                                  maybe_hfsplus = 0;                                  maybe_hfsplus = 0;
3152                          }                          }
3153    
3154                          if (count == 1) {                          if (count == 1) {
3155                                  ParseASCII(buf[0]);                                  ParseASCII(buf[0]);
                                 //code = buf[0];  
                                 //UnicodeToCP932(code, 2);  
3156                          }                          }
3157                          ParseASCII(b);                          ParseASCII(b);
                         //code = b;  
                         //UnicodeToCP932(code, 2);  
3158    
3159                          count = 0;  // reset counter                          count = 0;  // reset counter
3160                          return TRUE;                          return TRUE;
# Line 3177  BOOL ParseFirstUTF8(BYTE b, int hfsplus_ Line 3173  BOOL ParseFirstUTF8(BYTE b, int hfsplus_
3173                  (buf[1] & 0xc0) == 0x80) {                  (buf[1] & 0xc0) == 0x80) {
3174    
3175                  if (hfsplus_mode == 1 && maybe_hfsplus == 1) {                  if (hfsplus_mode == 1 && maybe_hfsplus == 1) {
3176                          UnicodeToCP932(first_code, 3);                          UnicodeToCP932(first_code);
3177                          maybe_hfsplus = 0;                          maybe_hfsplus = 0;
3178                  }                  }
3179    
3180                  code = ((buf[0] & 0x1f) << 6);                  code = ((buf[0] & 0x1f) << 6);
3181                  code |= ((buf[1] & 0x3f));                  code |= ((buf[1] & 0x3f));
3182    
3183                  UnicodeToCP932(code, 2);                  UnicodeToCP932(code);
3184    
3185                  // 次のバイトがASCIIならそのまま表示 (2006.6.30 yutaka)                  // 次のバイトがASCIIならそのまま表示 (2006.6.30 yutaka)
3186                  if ((b & 0x80) != 0x80) { // ASCII(0x00-0x7f)                  if ((b & 0x80) != 0x80) { // ASCII(0x00-0x7f)
# Line 3238  BOOL ParseFirstUTF8(BYTE b, int hfsplus_ Line 3234  BOOL ParseFirstUTF8(BYTE b, int hfsplus_
3234                                                          )) != -1) {                                                          )) != -1) {
3235    
3236                                                  // 1つめの文字はそのまま出力する                                                  // 1つめの文字はそのまま出力する
3237                                                  UnicodeToCP932(first_code, 3);                                                  UnicodeToCP932(first_code);
3238    
3239                                                  maybe_hfsplus = 1;                                                  maybe_hfsplus = 1;
3240                                                  first_code = code;                                                  first_code = code;
# Line 3246  BOOL ParseFirstUTF8(BYTE b, int hfsplus_ Line 3242  BOOL ParseFirstUTF8(BYTE b, int hfsplus_
3242                                                  return (TRUE);                                                  return (TRUE);
3243                                          }                                          }
3244    
3245                                          UnicodeToCP932(first_code, 3);                                          UnicodeToCP932(first_code);
3246                                          UnicodeToCP932(code, 3);                                          UnicodeToCP932(code);
3247                                          count = 0;                                          count = 0;
3248                                          return (TRUE);                                          return (TRUE);
3249                                  }                                  }
3250                          }                          }
3251                  }                  }
3252    
3253                  UnicodeToCP932(code, 3);                  UnicodeToCP932(code);
3254    
3255  skip:  skip:
3256                  count = 0;                  count = 0;

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

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