Open SmileXie opened 2 years ago
I am trying to print Chinese character in a ncurses screen
log::debug!("row str {}", row_str); ncurses::addstr(&row_str);
variable row_str is displayed well in as a parameter of log::debug , but get garbled by using ncurses::addstr.
row_str
log::debug
ncurses::addstr
i've tried to fix by the following 3 methods, but no one works.
// method 1 gettextrs::setlocale(gettextrs::LocaleCategory::LcAll, ""); // method 2 use libc::setlocale; unsafe { setlocale(0, "".as_bytes().as_ptr() as *const i8); } //method 3 ncurses::setlocale(ncurses::constants::LcCategory::all, "")
I am trying to print Chinese character in a ncurses screen
variable
row_str
is displayed well in as a parameter oflog::debug
, but get garbled by usingncurses::addstr
.i've tried to fix by the following 3 methods, but no one works.