UTF-8 support (initial commit)

This commit is contained in:
2026-03-10 18:51:58 +02:00
parent 110c4b4649
commit 27911d3886
31 changed files with 57 additions and 32 deletions
+9 -2
View File
@@ -1,7 +1,7 @@
#include "fs_file_list.h"
#include <dirent.h>
#include <errno.h>
#include <ncurses.h>
#include <ncursesw/ncurses.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
@@ -9,6 +9,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <uchar.h>
#include <unistd.h>
void reset_file_list(ui_fs_file_list_t *fl_ui);
@@ -181,7 +182,13 @@ void draw_fs_file_list(ui_fs_file_list_t *fl_ui) {
wattrset(win, COLOR_PAIR(3) | A_BOLD | A_REVERSE);
}
p_x = 1;
mvwprintw(win, p_y, p_x, "%s%n", el->name, &p_x);
/* TODO: */
wchar_t wname[512];
mbstowcs(wname, el->name, 512);
// wchar_t text[] = L"ВUTF-8 работает! → ★ ℝ 日本語\n";
mvwaddwstr(win, p_y, p_x++, L"Ё");
mvwaddwstr(win, p_y, p_x++, L"Ж");
// mvwprintw(win, p_y, p_x, "%s%n", el->name, &p_x);
mvwprintw(win, p_y, p_x + 1, "%*s", sz_x_f - p_x, "");
if (el == fl_ui->current) {
wattroff(win, COLOR_PAIR(3) | A_BOLD);