configure: add ncursesw detecting [try 2]

Vitaly Lipatov lav at etersoft.ru
Fri Dec 15 08:38:08 CST 2006


В сообщении от 15 декабря 2006 13:39 Alexandre Julliard написал(a):
> Vitaly Lipatov <lav at etersoft.ru> writes:
> > Try 2, with ncursesw/ncurses detecting
> > In order to build wineconsole run properly in utf8 locale, we use
> > ncursesw, which can handle wchar strings.
>
> Why would you need wchar strings if you use utf-8?  Have you
> configured your locale properly?
We can't get correct non latin output in utfed console with normal ncurses. As 
far as I know there is some problems in normal ncurses with utf8 (multbyte 
symbols)... Only ncursesw supports utf8 output correctly (and wide char)... I 
am wrong?

Follow is example code with try to out cyrillic text. If we run it utf8 
locale, only printf prints correct letters.

#include <ncurses.h>
#include <stdio.h>
#include <string.h>

int main()
{
   setlocale(0,"");
    int i=0;
   unsigned char cOut[] = {0xd0, 0x9f, 0xd1, 0x80, 0xd0, 0xb8, 0xd0, 0xb2, 
0xd0,0xb5,0xd1, 0x82,0x00 };

   printf("String with cyrillic symbols (out with printf):\n");
   printf("%s\n",cOut);    
   
    initscr();
   
   mvaddstr(2,0,"String with cyrillic symbols:");

   mvaddstr(4,0,cOut);
   refresh();
   getch();
   endwin();

   return 0;
}


-- 
Vitaly Lipatov, ALT Linux Team
Russia, Saint-Petersburg, www.etersoft.ru



More information about the wine-devel mailing list