| 22 |
#include "screen.h" |
#include "screen.h" |
| 23 |
#include "section_list.h" |
#include "section_list.h" |
| 24 |
#include "section_list_display.h" |
#include "section_list_display.h" |
| 25 |
|
#include "str_process.h" |
| 26 |
#include "trie_dict.h" |
#include "trie_dict.h" |
| 27 |
#include "user_list.h" |
#include "user_list.h" |
| 28 |
#include "user_priv.h" |
#include "user_priv.h" |
| 205 |
int ch; |
int ch; |
| 206 |
|
|
| 207 |
snprintf(msg, sizeof(msg), |
snprintf(msg, sizeof(msg), |
| 208 |
"\rChoose character set in 5 seconds [UTF-8, GBK]: [U/g]"); |
"\rChoose character set in 3 seconds [UTF-8, GBK]: [U/g]"); |
| 209 |
|
|
| 210 |
while (!SYS_server_exit) |
while (!SYS_server_exit) |
| 211 |
{ |
{ |
| 212 |
ch = press_any_key_ex(msg, 5); |
ch = press_any_key_ex(msg, 3); |
| 213 |
switch (ch) |
switch (toupper(ch)) |
| 214 |
{ |
{ |
| 215 |
case KEY_NULL: |
case KEY_NULL: |
| 216 |
return -1; |
return -1; |
| 217 |
case KEY_TIMEOUT: |
case KEY_TIMEOUT: |
| 218 |
case CR: |
case CR: |
|
case 'u': |
|
| 219 |
case 'U': |
case 'U': |
| 220 |
return 0; |
break; |
|
case 'g': |
|
| 221 |
case 'G': |
case 'G': |
| 222 |
if (io_conv_init("GBK") < 0) |
if (io_conv_init("GBK") < 0) |
| 223 |
{ |
{ |
| 224 |
log_error("io_conv_init(%s) error\n", "GBK"); |
log_error("io_conv_init(%s) error\n", "GBK"); |
| 225 |
return -1; |
return -1; |
| 226 |
} |
} |
| 227 |
return 0; |
break; |
| 228 |
default: |
default: |
| 229 |
continue; |
continue; |
| 230 |
} |
} |
| 231 |
|
|
| 232 |
|
break; |
| 233 |
|
} |
| 234 |
|
|
| 235 |
|
snprintf(msg, sizeof(msg), |
| 236 |
|
"\rChoose wide-character display in 3 seconds [Fixed, Dynamic]: [F/d]"); |
| 237 |
|
|
| 238 |
|
while (!SYS_server_exit) |
| 239 |
|
{ |
| 240 |
|
ch = press_any_key_ex(msg, 3); |
| 241 |
|
switch (toupper(ch)) |
| 242 |
|
{ |
| 243 |
|
case KEY_NULL: |
| 244 |
|
return -1; |
| 245 |
|
case KEY_TIMEOUT: |
| 246 |
|
case CR: |
| 247 |
|
case 'F': |
| 248 |
|
UTF8_fixed_width = 1; |
| 249 |
|
break; |
| 250 |
|
case 'D': |
| 251 |
|
UTF8_fixed_width = 0; |
| 252 |
|
break; |
| 253 |
|
default: |
| 254 |
|
continue; |
| 255 |
|
} |
| 256 |
|
|
| 257 |
|
break; |
| 258 |
} |
} |
| 259 |
|
|
| 260 |
return 0; |
return 0; |