Use C.UTF-8 instead of C in console, and set the consolefont for it

This commit is contained in:
Xi Ruoyao 2024-01-29 01:47:41 +08:00
parent 7c630340c2
commit 4ecfc55ddb
No known key found for this signature in database
GPG Key ID: ACAAD20E19E710E3
3 changed files with 46 additions and 3 deletions

View File

@ -74,6 +74,20 @@
</variablelist> </variablelist>
<para>We'll use <literal>C.UTF-8</literal> as the locale for interactive
sessions in the Linux console in <xref role='.'
linkend='ch-config-locale'/> The only console font shipped by
the <application>Kbd</application> package containing the glyphs for
all characters from the program messages in the <literal>C.UTF-8</literal>
locale is <filename>Lat2-Terminus16</filename> (the other shipped console
fonts lack glyphs of some characters like the Unicode left/right
quotation marks and the Unicode English dash). So set
<filename>Lat2-Terminus16</filename> as the default console font:</para>
<!-- We are using "nodump" for general settings, but not examples. This
is ironic, but needed for the compatibility with jhalfs! -->
<screen role='nodump'><userinput>echo <literal>FONT=Lat2-Terminus16</literal> &gt; /etc/vconsole.conf</userinput></screen>
<para>An example for a German keyboard and console is given below:</para> <para>An example for a German keyboard and console is given below:</para>
<!-- This is what is used by jhalfs for creating the vconsole.conf file. <!-- This is what is used by jhalfs for creating the vconsole.conf file.
Whenever you want to change the following, please inform the jhalfs Whenever you want to change the following, please inform the jhalfs

View File

@ -131,7 +131,7 @@ EOF</userinput></screen>
determined to set the desired locale</phrase><phrase determined to set the desired locale</phrase><phrase
revision='systemd'>to read the locale settings from revision='systemd'>to read the locale settings from
<filename>/etc/locale.conf</filename> and export them</phrase>, <filename>/etc/locale.conf</filename> and export them</phrase>,
but set the <literal>C</literal> locale instead if running in the Linux but set the <literal>C.UTF-8</literal> locale instead if running in the Linux
console (to prevent programs from outputting characters that the Linux console (to prevent programs from outputting characters that the Linux
console is unable to render):</para> console is unable to render):</para>
@ -143,7 +143,7 @@ for i in $(locale); do
done done
if [[ "$TERM" = linux ]]; then if [[ "$TERM" = linux ]]; then
export LANG=C export LANG=C.UTF-8
else else
source /etc/locale.conf source /etc/locale.conf
@ -166,7 +166,7 @@ for i in $(locale); do
done done
if [[ "$TERM" = linux ]]; then if [[ "$TERM" = linux ]]; then
export LANG=C export LANG=C.UTF-8
else else
export LANG=<replaceable>&lt;ll&gt;_&lt;CC&gt;.&lt;charmap&gt;&lt;@modifiers&gt;</replaceable> export LANG=<replaceable>&lt;ll&gt;_&lt;CC&gt;.&lt;charmap&gt;&lt;@modifiers&gt;</replaceable>
fi fi

View File

@ -432,6 +432,35 @@ EOF</userinput></screen>
<para>Some examples:</para> <para>Some examples:</para>
<itemizedlist> <itemizedlist>
<listitem>
<para>
We'll use <literal>C.UTF-8</literal> as the locale for interactive
sessions in the Linux console in <xref role=','
linkend='ch-config-locale'/> so we should set
<literal>UNICODE</literal> to <literal>1</literal>. And the only
console font shipped by the <application>Kbd</application> package
containing the glyphs for all characters from the program messages
in the <literal>C.UTF-8</literal> locale is
<filename>Lat2-Terminus16</filename> (the other shipped console
fonts lack glyphs of some characters like the Unicode left/right
quotation marks and the Unicode English dash). So set
<filename>Lat2-Terminus16</filename> as the default console
font:
</para>
<!-- We are using 'nodump' for the generic setting, but not for an
example (see below). This is deliberate to keep the
compatibility with jhalfs. -->
<screen role='nodump'><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
<literal># Begin /etc/sysconfig/console
UNICODE="1"
FONT="Lat2-Terminus16"
# End /etc/sysconfig/console</literal>
EOF</userinput></screen>
</listitem>
<listitem> <listitem>
<para>For a non-Unicode setup, only the KEYMAP and FONT variables are <para>For a non-Unicode setup, only the KEYMAP and FONT variables are