Browse Subversion Repository
Diff of /trunk/teraterm/teraterm/vtterm.c
Parent Directory
| Revision Log
| Patch
| 5519 |
} |
} |
| 5520 |
|
|
| 5521 |
// UTF-8で受信データを処理する |
// UTF-8で受信データを処理する |
|
BOOL ParseFirstUTF8(BYTE b, int proc_combining) |
|
| 5522 |
// returns TRUE if b is processed |
// returns TRUE if b is processed |
| 5523 |
// (actually allways returns TRUE) |
// (actually allways returns TRUE) |
| 5524 |
|
static BOOL ParseFirstUTF8(BYTE b, int proc_combining) |
| 5525 |
{ |
{ |
| 5526 |
static BYTE buf[3]; |
static BYTE buf[4]; |
| 5527 |
static int count = 0; |
static int count = 0; |
| 5528 |
static int can_combining = 0; |
static int can_combining = 0; |
| 5529 |
static unsigned int first_code; |
static unsigned int first_code; |
| 5586 |
return TRUE; |
return TRUE; |
| 5587 |
} |
} |
| 5588 |
|
|
| 5589 |
if ((buf[0] & 0xe0) == 0xe0 && |
if ((buf[0] & 0xf0) == 0xe0 && |
| 5590 |
(buf[1] & 0xc0) == 0x80 && |
(buf[1] & 0xc0) == 0x80 && |
| 5591 |
(buf[2] & 0xc0) == 0x80) { // 3バイトコードの場合 |
(buf[2] & 0xc0) == 0x80) { // 3バイトコードの場合 |
| 5592 |
|
|
| 5643 |
skip: |
skip: |
| 5644 |
count = 0; |
count = 0; |
| 5645 |
|
|
| 5646 |
|
} |
| 5647 |
|
|
| 5648 |
|
if (count < 4) { |
| 5649 |
|
return TRUE; |
| 5650 |
|
} |
| 5651 |
|
|
| 5652 |
|
if ((buf[0] & 0xf1) == 0xf0 && |
| 5653 |
|
(buf[1] & 0xc0) == 0x80 && |
| 5654 |
|
(buf[2] & 0xc0) == 0x80 && |
| 5655 |
|
(buf[2] & 0xc0) == 0x80) |
| 5656 |
|
{ // 4バイトコードの場合 |
| 5657 |
|
code = ((buf[0] & 0x07) << 18); |
| 5658 |
|
code |= ((buf[1] & 0x3f) << 12); |
| 5659 |
|
code |= ((buf[2] & 0x3f) << 6); |
| 5660 |
|
code |= (buf[3] & 0x3f); |
| 5661 |
|
|
| 5662 |
|
UnicodeToCP932(code); |
| 5663 |
|
count = 0; |
| 5664 |
|
return TRUE; |
| 5665 |
} else { |
} else { |
| 5666 |
ParseASCII(buf[0]); |
ParseASCII(buf[0]); |
| 5667 |
ParseASCII(buf[1]); |
ParseASCII(buf[1]); |
| 5668 |
ParseASCII(buf[2]); |
ParseASCII(buf[2]); |
| 5669 |
|
ParseASCII(buf[3]); |
| 5670 |
count = 0; |
count = 0; |
|
|
|
| 5671 |
} |
} |
| 5672 |
|
|
| 5673 |
return TRUE; |
return TRUE; |
|
|
Legend:
| Removed from v.7427 |
|
| changed lines |
| |
Added in v.7430 |
|
|
|