mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-11-30 02:58:26 +08:00
platform windows support output utf8 text to console
This commit is contained in:
parent
9b30e73519
commit
2ec126c504
@ -6,6 +6,7 @@
|
||||
* 增加函数tk\_to\_utf8\_argv
|
||||
* 增加函数tk\_free\_utf8\_argv
|
||||
* 增加宏MAIN/END\_MAIN
|
||||
* 完善Windows平台初始化,让Console输出支持UTF8。
|
||||
|
||||
2023/08/16
|
||||
* 增加函数str\_equal/wstr\_eq/wstr\_create/wstr\_destroy/wstr\_append\_more等函数
|
||||
|
@ -51,7 +51,6 @@ static int32_t get_local_timezone() {
|
||||
return timezone;
|
||||
}
|
||||
|
||||
|
||||
int gettimeofday(struct timeval* tp, void* tzp) {
|
||||
time_t clock;
|
||||
struct tm tm;
|
||||
@ -254,6 +253,19 @@ ret_t platform_prepare(void) {
|
||||
|
||||
stm_time_init();
|
||||
|
||||
#ifdef WIN32
|
||||
/*let console output support utf8 text*/
|
||||
if (!IsValidCodePage(CP_UTF8)) {
|
||||
log_debug("Not support UTF-8 output\n");
|
||||
}
|
||||
if (!SetConsoleCP(CP_UTF8)) {
|
||||
log_debug("Not support UTF-8 output\n");
|
||||
}
|
||||
if (!SetConsoleOutputCP(CP_UTF8)) {
|
||||
log_debug("Not support UTF-8 output\n");
|
||||
}
|
||||
#endif /*WIN32*/
|
||||
|
||||
#ifndef HAS_STD_MALLOC
|
||||
#ifndef TK_HEAP_MEM_SIZE
|
||||
#define TK_HEAP_MEM_SIZE 12 * 1024 * 1024
|
||||
|
Loading…
Reference in New Issue
Block a user