#864969 Ada.Locales ignores setting of LANG

Package:
gnat-12
Source:
gcc-12
Description:
GNU Ada compiler
Submitter:
Jacob Sparre Andersen
Date:
2022-04-04 05:33:33 UTC
Severity:
normal
Tags:
#864969#5
Date:
2017-06-16 15:53:54 UTC
From:
To:
Dear Maintainer,

I compiled and ran this program:

with Ada.Locales;
with Ada.Text_IO;

procedure Lang is
   use Ada.Locales;
   use Ada.Text_IO;
begin
   Put_Line (Country (1) & Country (2));
   Put_Line (Language (1) & Language (2) & Language (3));
end Lang;

The output is:

$ ./lang
ZZ
und
$ locale
LANG=fo_FO.ISO-8859-1
[...]
LC_ALL=
$

The expected output was:

$ ./lang
FO
fae
$

Thanks,

Jacob

#864969#20
Date:
2017-06-28 20:22:34 UTC
From:
To:
Ada.Locales.Country_Code is a thin wrapper to locales.c.
void c_get_country_code (char4 p) {
   char *r = "ZZ";
   for (; *r != '\0'; p++, r++)
      *p = *r;
}
This looks like a forgotten placeholder.