[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 8bit characters and form fields
From: |
Roberto Sebastiano |
Subject: |
Re: 8bit characters and form fields |
Date: |
05 Sep 2002 22:30:58 +0200 |
Il gio, 2002-09-05 alle 21:30, Thomas Dickey ha scritto:
> On Thu, Sep 05, 2002 at 03:29:02PM +0200, Roberto Sebastiano wrote:
> > Hi,
> > it is normal that strings containing 8-bit characters (like èàò) are
> > *not* displayed in any form field ? I simply get a blank field with that
> > strings (fine with 7-bit chars).
> > I set the buffer directly so it's not a "user typing problem".
>
> but what is your locale set to?
I use Debian Unstable, and hopefully all the locale related things are
correct.
Note that printing the string with printw or such is just fine.
address@hidden:~$ echo $LANG
it_IT.ISO-8859-1
Version information:
ii libncurses5 5.2.20020112a-8
ii libncurses5-dbg 5.2.20020112a-8
ii libncurses5-dev 5.2.20020112a-8
Attached is a simple test to trigger the problem.
Bye,
Roberto
#include <ncurses.h>
#include <form.h>
int main(){
FIELD *field[1];
FORM *my_form;
char *badstring;
badstring = "Test: àèìòù"; // With this, you get a blank screen
// badstring = "Test: aeiou"; // With this, you get the right string
// Initialization
initscr(); cbreak();
noecho();
keypad(stdscr, TRUE);
refresh();
// Initialize the field
field[0] = new_field(1, 50, 1, 10, 0, 0);
field[1] = NULL;
// Set field buffer
set_field_buffer(field[0], 0, badstring);
// Create the form and post it
my_form = new_form(field);
post_form(my_form);
refresh();
// Loop
while(getch() != 'q'){
}
// clen exit
endwin();
}