1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-12-08 04:16:34 +01:00

Add wide char support in toxic (issue #440)

Set current locale, use of get_wch instead of getch for reading, use
wctomb and friends to convert back from wchar_t, link with
cursesw. Unicode support is only added to chat windows.
This commit is contained in:
Manuel Argüelles
2013-08-21 16:19:35 -05:00
parent 46b69e6db1
commit 422a89d32d
7 changed files with 66 additions and 23 deletions

3
main.c
View File

@@ -2,6 +2,7 @@
* Toxic -- Tox Curses Client
*/
#define _XOPEN_SOURCE_EXTENDED
#include <curses.h>
#include <errno.h>
#include <stdio.h>
@@ -9,6 +10,7 @@
#include <stdbool.h>
#include <stdint.h>
#include <signal.h>
#include <locale.h>
#ifdef _win32
#include <direct.h>
@@ -40,6 +42,7 @@ static void init_term()
{
/* Setup terminal */
signal(SIGWINCH, on_window_resize);
setlocale(LC_ALL, "");
initscr();
cbreak();
keypad(stdscr, 1);