Switch from default to user defined codepage
This commit is contained in:
parent
8b611fc3fe
commit
db59e0e4b2
8
doors.c
8
doors.c
@ -309,10 +309,10 @@ void runexternal(struct user_record *user, char *cmd, int stdio, char *argv[], c
|
||||
}
|
||||
}
|
||||
}
|
||||
if (codepage == NULL || (strcmp(codepage, "CP437") == 0 && conf.codepage == 0) || (strcmp(codepage, "UTF-8") == 0 && conf.codepage == 1)) {
|
||||
if (codepage == NULL || (strcmp(codepage, "CP437") == 0 && gUser->codepage == 0) || (strcmp(codepage, "UTF-8") == 0 && gUser->codepage == 1)) {
|
||||
write(master, outbuf, g);
|
||||
} else {
|
||||
if (conf.codepage == 0) {
|
||||
if (gUser->codepage == 0) {
|
||||
ic = iconv_open("CP437", codepage);
|
||||
} else {
|
||||
ic = iconv_open("UTF-8", codepage);
|
||||
@ -344,10 +344,10 @@ void runexternal(struct user_record *user, char *cmd, int stdio, char *argv[], c
|
||||
}
|
||||
outbuf[g++] = c;
|
||||
}
|
||||
if (codepage == NULL || (strcmp(codepage, "CP437") == 0 && conf.codepage == 0) || (strcmp(codepage, "UTF-8") == 0 && conf.codepage == 1)) {
|
||||
if (codepage == NULL || (strcmp(codepage, "CP437") == 0 && gUser->codepage == 0) || (strcmp(codepage, "UTF-8") == 0 && gUser->codepage == 1)) {
|
||||
write(door_out, outbuf, g);
|
||||
} else {
|
||||
if (conf.codepage == 0) {
|
||||
if (gUser->codepage == 0) {
|
||||
ic = iconv_open(codepage, "CP437");
|
||||
} else {
|
||||
ic = iconv_open(codepage, "UTF-8");
|
||||
|
Reference in New Issue
Block a user