aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Burgess <matthew@linuxfromscratch.org>2005-11-12 09:43:22 +0000
committerMatthew Burgess <matthew@linuxfromscratch.org>2005-11-12 09:43:22 +0000
commitf30e12dde94debfed2ff1134c1f168d5c8460d6d (patch)
tree4933ab8cfabcebfb640c162be32441e14a204235
parent400ae36936baf0e4d0fb7e1cdbb8f9ac4de53a13 (diff)
Improve the heuristic for selecting a supported/working locale
git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/6.1.1/BOOK@7145 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
-rw-r--r--chapter01/changelog.xml5
-rw-r--r--chapter06/glibc.xml22
-rw-r--r--chapter07/profile.xml41
3 files changed, 56 insertions, 12 deletions
diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml
index 2152fd520..55fd5a38a 100644
--- a/chapter01/changelog.xml
+++ b/chapter01/changelog.xml
@@ -42,6 +42,11 @@ First a summary, then a detailed log.</para>
</itemizedlist>
</listitem>
+<listitem><para>November 12, 2005 [matt]: Improve the heuristic for determining
+a locale that is supported by both Glibc and packages outside LFS (bug 1642).
+Many thanks to Alexander Patrakov for highlighting the numerous issues and for
+reviewing the various suggested fixes.</para></listitem>
+
<listitem><para>November 12, 2005 [matt]: Omit running Bzip2's testsuite as a
separate step, as <command>make</command> runs it automatically (bug 1652).
</para></listitem>
diff --git a/chapter06/glibc.xml b/chapter06/glibc.xml
index 9ff4f18af..a30b2e308 100644
--- a/chapter06/glibc.xml
+++ b/chapter06/glibc.xml
@@ -148,11 +148,11 @@ with:</para>
<screen><userinput>make localedata/install-locales</userinput></screen>
<para>To save time, an alternative to running the
-previous command (which generates and installs every locale Glibc is
-aware of) is to install only those locales that are wanted and needed.
-This can be achieved by using the <command>localedef</command>
-command. Information on this command is located in the
-<filename>INSTALL</filename> file in the Glibc source. However, there
+previous command (which generates and installs every locale listed in the
+glibc-&glibc-version;/localedata/SUPPORTED file) is to install only those
+locales that are wanted and needed. This can be achieved by using the
+<command>localedef</command> command. Information on this command is located in
+the <filename>INSTALL</filename> file in the Glibc source. However, there
are a number of locales that are essential in order for the tests of
future packages to pass, in particular, the
<emphasis>libstdc++</emphasis> tests from GCC. The following
@@ -181,12 +181,12 @@ programmers making assumptions that break in such locales, LFS should
not be used in locales that utilize multibyte character sets
(including UTF-8) or right-to-left writing order. Numerous unofficial
and unstable patches are required to fix these problems, and it has
-been decided by the LFS developers not to support such complex locales. This applies to the
-ja_JP and fa_IR locales as well&mdash;they have been installed only for
-GCC and Gettext tests to pass, and the <command>watch</command> program
-(part of the Procps package) does not work properly in them. Various
-attempts to circumvent these restrictions are documented in
-internationalization-related hints.</para>
+been decided by the LFS developers not to support such complex locales at this
+time. This applies to the ja_JP and fa_IR locales as well&mdash;they have been
+installed only for GCC and Gettext tests to pass, and the
+<command>watch</command> program (part of the Procps package) does not work
+properly in them. Various attempts to circumvent these restrictions are
+documented in internationalization-related hints.</para>
<para>Build the linuxthreads man pages, which are a great reference
on the threading API (applicable to NPTL as well):</para>
diff --git a/chapter07/profile.xml b/chapter07/profile.xml
index 5748762cb..270142a1a 100644
--- a/chapter07/profile.xml
+++ b/chapter07/profile.xml
@@ -83,7 +83,46 @@ will print:</para>
<screen>ISO-8859-1</screen>
-<para>This results in a final locale setting of <quote>en_GB.ISO-8859-1</quote>.</para>
+<para>This results in a final locale setting of <quote>en_GB.ISO-8859-1</quote>.
+It is important that the locale found using the heuristic above is tested prior
+to it being added to the Bash startup files:</para>
+
+<screen><userinput>LC_ALL=[locale name] locale country
+LC_ALL=[locale name] locale language
+LC_ALL=[locale name] locale charmap
+LC_ALL=[locale name] locale int_curr_symbol
+LC_ALL=[locale name] locale int_prefix</userinput></screen>
+
+<para>The above commands should print the country and language names, the
+character encoding used by the locale, the local currency and the prefix to dial
+before the telephone number in order to get into the country. If any of the
+commands above fail with a message similar to the one shown below, this means
+that your locale was either not installed in Chapter 6 or is not supported by
+the default installation of Glibc.</para>
+
+<para><computeroutput>locale: Cannot set LC_* to default locale: No such file or directory</computeroutput></para>
+
+<para>If this happens, you should either install the desired locale using the <command>localedef</command> command, or consider choosing a different locale.
+Further instructions assume that there are no such error messages from Glibc.
+</para>
+
+<para>Some packages beyond LFS may also lack support for your chosen locale. One
+example is the X library (part of the X Window System), which outputs the
+following error message:</para>
+
+<para><computeroutput>Warning: locale not supported by Xlib, locale set to C</computeroutput></para>
+
+<para>Sometimes it is possible to fix this by removing the charmap part of the
+locale specification, as long as that does not change the character map that
+Glibc associates with the locale (this can be checked by running the
+<command>locale charmap</command> command in both locales). For example, one
+would have to change &quot;de_DE.ISO-8859-15@euro&quot; to
+&quot;de_DE@euro&quot; in order to get this locale recognized by Xlib.</para>
+
+<para>Other packages can also function incorrectly (but may not necessarily
+display any error messages) if the locale name does not meet their expectations.
+In those cases, investigating how other Linux distributions support your locale
+might provide some useful information.</para>
<para>Once the proper locale settings have been determined, create the
<filename>/etc/profile</filename> file:</para>