Skip to content

Commit de66ce8

Browse files
committed
EUC-JP can be triple byte
1 parent 151698b commit de66ce8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/enc/pm_euc_jp.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ pm_encoding_euc_jp_char_width(const uint8_t *b, ptrdiff_t n) {
1818
return 2;
1919
}
2020

21+
// These are the triple byte characters.
22+
if (
23+
(n > 2) &&
24+
(b[0] == 0x8F) &&
25+
(b[1] >= 0xA1 && b[2] <= 0xFE) &&
26+
(b[2] >= 0xA1 && b[2] <= 0xFE)
27+
) {
28+
return 3;
29+
}
30+
2131
return 0;
2232
}
2333

0 commit comments

Comments
 (0)