#178 Accents are not displayed under linux

open
nobody
None
5
2009-05-07
2009-05-07
Anonymous
No

Hi,

I'm using the latest version of THE (excellent editor++!!! Thanks) under linux.
I enabled extended characters by setting SET ETMODE ON 32-255.

The problem is that accents are not displayed. Instead there are 2 squares.

The solution is quite simple.
In the file "the.c" you have to include "locale.h" and just before the initscr() you have to add a call to setlocale() like this:

setlocale(LC_ALL, "");
initscr();

This simple code enables accents.

Thanks
Regards

Valere Monseur
valere_monseur@hotmail.com

Discussion

  • Patch file:

    --- the.c 2009-05-10 08:32:42.000000000 +0200
    +++ new_the.c 2009-05-10 08:31:52.000000000 +0200
    @@ -39,6 +39,10 @@
    #include <proto.h>
    #include <time.h>

    +#if defined(UNIX) && !defined(XCURSES)
    + #include <locale.h>
    +#endif
    +
    #include "mygetopt.h"

    #if defined(DOS) || defined(OS2)
    @@ -972,6 +976,9 @@
    if ( initscr_argc )
    (*the_free)( initscr_argv );
    #else
    + #ifdef UNIX
    + setlocale(LC_ALL, "");
    + #endif
    initscr();
    #endif
    curses_started = TRUE;

     
  • Hum, I didn't get that it was an ascii (or ebcdic) based editor. Not unicode -> accents are not working very well inside an utf8 terminal.

    I can understand it's an big work to change such a thing so...I'll live with it.