mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-10-11 00:38:18 +03:00
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:
+1
-1
@@ -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++) {
|
||||
|
||||
Reference in New Issue
Block a user