Skip to content

Commit 0fccd6f

Browse files
committedJun 8, 2020
Update EUC-KR index file gen algorithm
1 parent bd3cd35 commit 0fccd6f

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed
 

‎generation/gen-dbcs.js

+2-12
Original file line numberDiff line numberDiff line change
@@ -126,18 +126,8 @@ async.parallel({
126126
eucKr[i] = i;
127127
for (var i = 0x8100; i < 0xFF00; i++) {
128128
var lead = i >> 8, byte = i & 0xFF, ptr = null, t;
129-
if (lead <= 0xC6) {
130-
t = (26+26+126)*(lead-0x81) + byte;
131-
if (0x41 <= byte && byte <= 0x5A)
132-
ptr = t - 0x41;
133-
else if (0x61 <= byte && byte <= 0x7A)
134-
ptr = t + 26 - 0x61;
135-
else if (0x81 <= byte && byte <= 0xFE)
136-
ptr = t + 26 + 26 - 0x81;
137-
} else {
138-
if (0xA1 <= byte && byte <= 0xFE)
139-
ptr = (26+26+126)*(0xC7-0x81) + (lead-0xC7)*94+(byte-0xA1);
140-
}
129+
if (0x41 <= byte && byte <= 0xFE)
130+
ptr = (lead-0x81) * 190 + (byte-0x41);
141131
if (ptr !== null)
142132
eucKr[i] = data.$eucKr[ptr];
143133

0 commit comments

Comments
 (0)
Please sign in to comment.