Re: vt and keyboard accents
- In reply to: Hans Petter Selasky : "Re: vt and keyboard accents"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 29 Jan 2023 07:52:08 UTC
On Sun, Jan 29, 2023 at 10:16 AM Hans Petter Selasky <hps@selasky.org>
wrote:
> On 1/29/23 01:54, Yuri wrote:
> > Looking into an issue with accents input for vt and cz (so
> > /usr/share/vt/keymaps/cz.kbd) keyboard where some of the accents are
> > working and other result weird unrelated characters output.
> >
> > Checking kbdcontrol -d output, there is an obvious difference with
> > keymap contents -- all mappings are trimmed down to 1 byte after reading:
> >
> > kbdcontrol:
> > dacu 180 ( 180 180 ) ( 'S' 'Z' ) ( 'Z' 'y' ) ( 's' '[' )
> > ( 'z' 'z' ) ( 'R' 'T' ) ( 'A' 193 ) ( 'L' '9' )
> > ( 'C' 006 ) ( 'E' 201 ) ( 'I' 205 ) ( 'N' 'C' )
> > ( 'O' 211 ) ( 'U' 218 ) ( 'Y' 221 ) ( 'r' 'U' )
> > ( 'a' 225 ) ( 'l' ':' ) ( 'c' 007 ) ( 'e' 233 )
> > ( 'i' 237 ) ( 'n' 'D' ) ( 'o' 243 ) ( 'u' 250 )
> > ( 'y' 253 )
> >
> > keymap:
> > dacu 0xb4 ( 0xb4 0xb4 ) ( 'S' 0x015a ) ( 'Z' 0x0179 )
> > ( 's' 0x015b )
> > ( 'z' 0x017a ) ( 'R' 0x0154 ) ( 'A' 0xc1 )
> > ( 'L' 0x0139 )
> > ( 'C' 0x0106 ) ( 'E' 0xc9 ) ( 'I' 0xcd )
> > ( 'N' 0x0143 )
> > ( 'O' 0xd3 ) ( 'U' 0xda ) ( 'Y' 0xdd )
> > ( 'r' 0x0155 )
> > ( 'a' 0xe1 ) ( 'l' 0x013a ) ( 'c' 0x0107 )
> > ( 'e' 0xe9 )
> > ( 'i' 0xed ) ( 'n' 0x0144 ) ( 'o' 0xf3 )
> > ( 'u' 0xfa )
> > ( 'y' 0xfd )
> >
> > Source of the problem is the following definition in sys/sys/kbio.h:
> >
> > struct acc_t {
> > u_char accchar;
> > u_char map[NUM_ACCENTCHARS][2];
> > };
> >
> > While the keymaps were converted to have the unicode characters for vt
> > in the commit below, the array to store them (map) was missed, or was
> > there a reason for this?
> >
> > ---
> > commit 7ba08f814546ece02e0193edc12cf6eb4d5cb8d4
> > Author: Stefan Eßer <se@FreeBSD.org>
> > Date: Sun Aug 17 19:54:21 2014 +0000
> >
> > Attempt at converting the SYSCONS keymaps to Unicode for use with
> > NEWCONS.
> > I have spent many hours comparing source and destination formats,
> > and hope
> > to have caught the most severe conversion errors.
> > ---
> >
> > I have tried the following patch and it allows me to enter all accents
> > documented in the keymap, though I must admit I'm not sure it does not
> > have hidden issues:
> >
> > diff --git a/sys/sys/kbio.h b/sys/sys/kbio.h
> > index 7f17bda76c5..fffeb63e226 100644
> > --- a/sys/sys/kbio.h
> > +++ b/sys/sys/kbio.h
> > @@ -200,7 +200,7 @@ typedef struct okeymap okeymap_t;
> >
> > struct acc_t {
> > u_char accchar;
> > - u_char map[NUM_ACCENTCHARS][2];
> > + int map[NUM_ACCENTCHARS][2];
> > };
> >
>
> Hi,
>
> Using "int" for unicode characters is probably good for now. Your patch
> looks good, but please also consider the "umlaut" case while at it
> (multiple characters that become one)!
>
> --HPS
>
>
I am not an expert on UNICODE .
When character sets are considered , a homogeneous definition for all of
the FreeBSD system would be more useful .
There are mainly three types of Unicode : UTF-8 , UTF-16 , and UTF-32 where
numbers are bit sizes of the characters .
Some pages about Unicode where they have many linked sub pages :
https://en.wikipedia.org/wiki/Category:Unicode
Category:Unicode
https://en.wikipedia.org/wiki/Unicode
Unicode
https://en.wikipedia.org/wiki/Comparison_of_Unicode_encodings
Comparison of Unicode encodings
https://en.wikipedia.org/wiki/List_of_binary_codes
List of binary codes
https://en.wikipedia.org/wiki/List_of_information_system_character_sets
List of information system character sets
and other related pages ...
With my best wishes for all .
Mehmet Erol Sanliturk