aboutsummaryrefslogtreecommitdiff
path: root/src/textadept.c
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2012-06-24 14:32:07 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2012-06-24 14:32:07 -0400
commit51136aba16a9d070de374627e361a359ec7b9578 (patch)
tree39e26a066af98272eae24489a000eda6928a7289 /src/textadept.c
parent2ec5985f9c645fb53c0c327c1fbd514e68c614a7 (diff)
downloadtextadept-51136aba16a9d070de374627e361a359ec7b9578.tar.gz
textadept-51136aba16a9d070de374627e361a359ec7b9578.zip
Handle UTF-8 characters correctly in ncurses.
Diffstat (limited to 'src/textadept.c')
-rw-r--r--src/textadept.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/textadept.c b/src/textadept.c
index 624cec61..fdf80595 100644
--- a/src/textadept.c
+++ b/src/textadept.c
@@ -1376,7 +1376,7 @@ static int lstring_iconv(lua_State *L) {
const char *to = luaL_checkstring(L, 2), *from = luaL_checkstring(L, 3);
int converted = FALSE;
iconv_t cd = iconv_open(to, from);
- if (cd != (iconv_t) -1) {
+ if (cd != (iconv_t)-1) {
char *out = malloc(text_len + 1), *outp = out;
size_t inbytesleft = text_len, outbytesleft = text_len;
if (iconv(cd, &text, &inbytesleft, &outp, &outbytesleft) != -1)
@@ -2175,6 +2175,7 @@ int main(int argc, char **argv) {
static struct termios oldterm;
tcgetattr(0, &oldterm); // save old terminal settings
TermKey *tk = termkey_new(0, TERMKEY_FLAG_NOTERMIOS);
+ setlocale(LC_CTYPE, ""); // for displaying UTF-8 characters properly
initscr(); // raw()/cbreak() and noecho() are taken care of in libtermkey
curs_set(0); // disable cursor when Scintilla has focus
#endif