Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

International keyboard support (Developers)

posted by tom Homepage, Germany (West), 14.02.2023, 12:17

> So based on my experiments and what I'm reading here, I think I can
> summarize it as follows:
>
> * Regardless of the physical keyboard layout, an application program
> reading the keyboard using the BIOS routines will see 8 bit values. (This
> can't change or the world would be broken.)

Right.

> * KEYB.COM is used to provide alternate mappings of keys to values returned
> by the BIOS, but ultimately you still get the same type of output - an 8
> bit value.

Right.

> * Special key sequences such as F1, Alt-X, etc. still generate a 0x0 and an
> 8 bit value that remains unchanged regardless of the KEYB.COM changes.

Right.

> * To convert an 8 bit character value to Unicode you need to know what
> codepage was specified

Right.

> with KEYB.COM.

wrong. codepage is a DISPLAY/VGA Bios thing, not related to the KEYB option.

example: as a german, I always used CP 437 (actually 850 now because €).
however I use the standard BIOS when using a US ASCII keyboard, but KEB GR when using a german keyboard.

Similarly when hitting CtrlAltF1/CtrlAltF2 to enable/disable KEYB, the codepage remains the same.

> Then you can try to map the 8 bit
> value received from the BIOS call to a Unicode codepoint.

Right. only in the context of the current codepage can you know if
0x9A is Ü (CP437) or ³ (CP869) and translate it to the correct UTF value.

> The test version of IRCjr I am writing is already mapping incoming Unicode
> to arbitrary values when it receives a message.

btw UNI2ASCI by Bret has done a really heroic effort to map dozens of UNICODE values that 'look similar to T' to the available 'T' (and the rest of a-zA-Z).

it's probably better to display 'A' when 'Ä' is not available in the current codepage then to display '?'.

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 79 users online (1 registered, 78 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum