View Full Version : Display extended ASCII characters
Ugluk911
March 20th, 2009, 19:01
HI.
Please excuse my english.
I try to setup my keyboard/console in C shell to display french canadian characters such as accents and others non english stuff.
I can modify the map file to make it behave the way I want except when I try to setup extended ASCII characters.
For example, I can setup ASCII 126 on scan code 56 but a "beep" occurs if I set it up to 132.
I conclued that the console can't display extended ASCII charaters... Am I right?
Does anyone could help me?
Thanks
Louis Tanguay
Quebec
trev
March 23rd, 2009, 11:32
I think you're wrong :-) Check the FreeBSD Handbook section on localisation at: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/using-localization.html
MG
March 23rd, 2009, 20:52
I don't know how to do it with echo/printf or escape sequences, but to prove it's possible, this is how to do it with C / ncurses:
This function draws a titled empty box and waits on keypress:
#include <ncurses.h>
//asciitest.c
drawbox(int x, int y, int height, int width, char title[])
{
int i;
mvaddch(y, x, ACS_ULCORNER);
for ( i = 1; i < width; i++) addch(ACS_HLINE);
addch(ACS_URCORNER);
for ( i = 1; i < height ; i++)
{
mvaddch(y + i, x, ACS_VLINE);
mvaddch(y + i, x + width, ACS_VLINE);
}
mvaddch( y + height, x, ACS_LLCORNER);
for ( i = 1; i < width; i++) addch(ACS_HLINE);
addch(ACS_LRCORNER);
mvaddstr(y, x + 2, "<");
if (title == "")
{
addch(ACS_DIAMOND);
}
else
{
addch(ACS_DIAMOND);
addch(32);
addstr(title);
addch(32);
addch(ACS_DIAMOND);
}
addstr(">");
}
main()
{
initscr();
// example call:
drawbox (15,5,20,60,"example title");
getch();
endwin();
}
compile like:
#cc -lncurses asciitest.c
and execute a.out
Ugluk911
March 24th, 2009, 14:12
I did some tests and I saw that I can configure the keyboard/console very well in ISO-8859-15 but when I change all the settings (login.conf, rc.conf, etc) for ISO-8859-1 the characters sets doesn't seems to match the table.
I simply changed ISO-8859-15 to ISO-8859-1 in all the config files (ttys is set to cons25l1).
What's the problem?
Thanks
Louis
Ugluk911
March 24th, 2009, 14:25
OK problem solved!!!
I just forgot to do # cap_mkdb /etc/login.conf to confirm the settings...
Thanks!
Louis
trev
March 25th, 2009, 05:40
Excellent!
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.