daniel.mantione at freepascal.org
Fri Nov 3 14:13:49 CET 2006
Op Fri, 3 Nov 2006, schreef Tomas Hajny:
> This is something to be addressed in video.pp - we need to detect the
> character set supported by console at startup (optionally with a
> possibility to change it later on). This is something we partly touched in
> discussion with Daniel in Eindhoven (but I haven't managed to do anything
> regarding video.pp since then, unfortunately :-((( ). Ability to use
> linedrawing characters directly depends on that, obviously.
No, this is a different issue than we talked about in Eindhoven. In
Eindhoven we talked about how FV should access line drawing characters.
This is about how the video unit draws them.
> Does anybody here have an idea how to address that issue in Unix/Linux
> environment (like an environment variable similar to TERM, etc.)? I can
> imagine we might need to define our own solution if no standard solution
> exists (e.g. we might require users to setup some environment variable
> explicitly on systems not providing such information in an automated way,
> plus have some reasonable default).
This sucks big time. There is no way to detect which encoding the terminal
uses. The user is expected to set his language in a LC_* variable, and
the libc assumes the encoding of the terminal matches the encoding that
belongs to the language.
Xterm supports two modes: ISO-8859-1 and UTF-8. There are two ways to use
a different code page:
* Put the xterm in ISO-8859-1 mode and just load a font with different
characters in #128..#255.
* Use proper fonts, but use an emulator that switches the terminal into
UTF-8 mode and emulates a terminal with the desired encoding. I forgot
the name of the emulator.
The line in question enables the use of the vt100 alternate character
set. You access the normal font by switching the terminal to the G0
charactert set, and the ACS by switching it into the G1 character set.
The ACS should be available when code page 1251 is in use.
However, the video unit emulates a code page 850 on a iso-8859-1, using
the ACS for the line-drawing characters. This doesn't work for Russian.
As a short term solution a conversion table should be added from a
Cyrillic Dos code page to 1251+ACS.
More information about the fpc-devel