Package: uil
Version: 2.3.4-6+deb8u1

Motif's UIL compiler has long had an annoying problem: it often reports
"$LANG contains an unknown character set" error message for
syntactically correct *.uil files (see
<https://motif.ics.com/forum/comp-error-lang-contains-unknown>, more
examples can be easily looked up).

The issue is caused by the fact that whenever an *.uil file doesn't
declare its encoding explicitly, UIL compiler assumes the encoding from
the environment (namely, LANG variable). At the same time, UIL doesn't
rely on the underlying C library but rather maintains its own static
list of supported encodings (in tools/wml/motif.wml).

The above leads to inability to not only use UIL in certain locales, but
also build Motif itself (as UIL is bootstrapped and invoked during the
build process).

Steps to reproduce:

1. Pick a syntactically valid *.uil file (without a "character_set"
clause, see
<http://www.oreilly.com/openbook/motif/vol6a/Vol6a_html/ch22.html#23_3_2>)

2. Run:

$ LANG=C uil -o output.uid input.uil

- the file will compile successfully, producing output.uid in the same
directory.

3. Run

$ LANG=ru_RU.CP1251 uil -o output.uid input.uil

- the "Error: $LANG contains an unknown character set" will be printed,
no *.uid file will be produced.

Attached is the patch that fixes the problem for Cyrillic locales.
Support has been added for "ISO-8859-5" (without the patch, LANG=ru_RU
is valid while LANG=ru_RU.ISO-8859-5 is not), "CP1251" and "IBM866"
charsets.
diff --git a/tools/wml/motif.wml b/tools/wml/motif.wml
index 1ad79e9..397040e 100644
--- a/tools/wml/motif.wml
+++ b/tools/wml/motif.wml
@@ -93,7 +93,8 @@ CharacterSet
           Alias = "ISOLatin5";
           Alias = "88595"; };
     iso_cyrillic
-        { XmStringCharsetName = "ISO8859-5"; };
+        { XmStringCharsetName = "ISO8859-5";
+          Alias = "ISO-8859-5"; };
     iso_arabic
         { XmStringCharsetName = "ISO8859-6";
           Alias = "iso_latin6";
@@ -161,6 +162,17 @@ CharacterSet
                   Alias = "KOI8R";
                   Alias = "KOI8U";
                   Alias = "KOI8RU"; };
+    ansi_cyrillic
+                { XmStringCharsetName = "CP1251";
+                  Alias = "WINDOWS-1251";
+                  Alias = "ANSI-1251";
+                  ! The name of CP1251 in Solaris
+                  Alias = "ANSI1251"; };
+    dos_cyrillic
+                { XmStringCharsetName = "IBM866";
+                  Alias = "IBM-866";
+                  Alias = "CP866";
+                  Alias = "866"; };
     XmFONTLIST_DEFAULT_TAG
         { FontListElementTag = XmFONTLIST_DEFAULT_TAG; };
 

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to