1 Star 0 Fork 16

src-openeuler-fork/vmtop

forked from src-openEuler/vmtop 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
fix-chinese-output-garbled.patch 1.02 KB
一键复制 编辑 原始数据 按行查看 历史
Venland 提交于 2025-03-20 17:11 +08:00 . fix chinese output garbled
diff --git a/configure.ac b/configure.ac
index 0acb1b7..4d95893 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,9 +13,9 @@ AM_INIT_AUTOMAKE([subdir-objects])
CC="$CC -std=gnu11"
# Checks for libraries.
-AC_CHECK_LIB(ncurses, initscr, [], [echo "missing ncurses support!";exit -1])
-NCURSES_LIBS="-lncurses"
-AC_SUBST([NCURSES_LIBS])
+AC_CHECK_LIB(ncursesw, initscr, [], [echo "missing ncurses support!";exit -1])
+NCURSESW_LIBS="-lncursesw"
+AC_SUBST([NCURSESW_LIBS])
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h unistd.h])
diff --git a/src/vmtop.c b/src/vmtop.c
index caa598e..78b6f4e 100644
--- a/src/vmtop.c
+++ b/src/vmtop.c
@@ -14,6 +14,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+#include <locale.h>
#include <ncurses.h>
#include "vmtop.h"
#include "field.h"
@@ -52,6 +53,7 @@ static void init_screen(void)
static void init_parameter(void)
{
+ setlocale(LC_ALL, "");
init_domains(&scr_cur);
init_domains(&scr_pre);
init_domains(&vcpu_list);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler-fork/vmtop.git
git@gitee.com:src-openeuler-fork/vmtop.git
src-openeuler-fork
vmtop
vmtop
master

搜索帮助