Fix bug (?) in utf2sjis

Don't generate SJIS with initial byte 0x80. I'm guessing that sjis2utf
handles initial byte 0x80 the way it does for compatibility reasons, but
there is no reason for utf2sjis to generate this coding.
This commit is contained in:
Nunuhara Cabbage
2020-02-06 21:54:35 -08:00
parent 4d9de80626
commit d8304b0e6f
+1 -1
View File
@@ -81,7 +81,7 @@ char *sjis2utf(const char *_src, size_t len) {
}
static int unicode_to_sjis(int u) {
for (int b1 = 0x80; b1 <= 0xff; b1++) {
for (int b1 = 0x81; b1 <= 0xff; b1++) {
if (b1 >= 0xa0 && b1 <= 0xdf)
continue;
for (int b2 = 0x40; b2 <= 0xff; b2++) {