Help with getting danish keyboard layout to work correctly (æøåÆØÅ characters)

Polytropon freebsd at edvax.de
Fri Jan 18 10:54:08 UTC 2019


On Fri, 18 Jan 2019 02:05:23 +0100, scootergrisen wrote:
> Can someone help with this bug?:
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=233031
> 
> I change to danish keyboard layout with kbdmap command in TTY.

Which exact command do you use?

Did you already think about using the equivalent /etc/rc.conf
setting? For example, I have

	keymap="de"

set, and german umlauts öäü ÖÄÜ and Eszett ß are being used
correctly. For you, setting "dk" should be fully sufficient.
Due to vt font problems (unreadable and tiny on a 21" screen),
I also have

	allscreens_flags="-f gallant"

which sets a different font at the end of the boot sequence.
It's not much better than the default, still unreadable...



> But æøåÆØÅ keys does not work correctly.

See end of message for exegesis of "work". ;-)



> It might be that the characters æøåÆØÅ are not in the default font.
> I want to try other fonts but i seems to be unable to change the font 
> with vidfont command.

First of all: Are you using vt as the console driver?
This should be the default on recent FreeBSD versions.

Verify that UTF-8 has been set. For comparison:

	% echo $LC_ALL
	de_DE.UTF-8

Stangely, I also get this:

	% echo $LANG
	de_DE.ISO8859-1

Sadly, I forgot about the precedence rules of $LANG and $LC_*.

For testing, you can experiment with the language settings in
your shell's initialization file. For the C shell, this is
~/.cshrc, and a logout - login cycle is a convenient way to
change settings.

In my opinion, you _should_ be fine with

	setenv	LANG	dk-DK.UTF-8

but you can try

	setenv	LANG	dk-DK.ISO8859-1

as well.

Furthermore, just verify that /etc/ttys contains "xterm" as the
terminal type for your virtual terminals; "cons25l1" which has
worked before has been deprecated as with vt, there is no text
mode anymore, all shiny graphics. :-)



> I tried adding this in /boot/loader.conf:
> hw.vga.textmode=0
> 
> But it still says this during boot:
> VT: text 80x25

And it probably doesn't work. ;-)



> I would like æøåÆØÅ characters to work in the TTY by default.

You need to pay attention to two things:

1. Are the keys accepted correctly?

2. Are the appropriate symbols printed?

Those are two different aspects of the same "work" thing. :-)

So even though aspect 1 might work correctly, i. e., when
you press å in an editor, the correct 2-byte sequence (due
to UTF-8 default!) will be written to the file, it could
happen that on the screen, you only see garbage, because
the å won't be displayed, and instead an "excuse" is printed
on the screen.



Sidenote:

If you don't want to use X, try to use sc instead of vt.
In /boot/loader.conf, set

	kern.vty=sc

In this case, you can also avoid using UTF-8 if you want, and
instead use the regular western europe ISO-8859 character set,
where å and ø, just like ü and ß, only require 1 byte. :-)




PS.
Yes, I'm not a big fan of vt at the moment. :-)

-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-bugs mailing list