On 18/07/2025 04:03, Collin Funk wrote:
Hi,
I've attached a basic test I wrote for the Thai solar calendar using
th_TH.UTF-8 based on the properties that Bruno described [1].
One thing I was unsure of was whether we have to check if the locale is
supported before using it. In other tests I see something like this:
export LC_ALL=en_US.UTF-8
if test "$(locale charmap 2>/dev/null)" = UTF-8; then
# tests here
fi
I could do that here if that is correct. But how would it be written for
"LC_ALL=fa_IR" and "LC_ALL=am_ET" which have no charset specified?
I'll hold off on writing the others until I get input on that. They
shouldn't be too difficult.
Collin
[1] https://lists.gnu.org/archive/html/bug-gnulib/2025-07/msg00102.html
Sorry for the tardy response. I was on holidays.
`locale charmap` should be enough to determine support for a locale.
There seems to be a default charmap for a locale
used when a specific charmap is not specified. For example:
$ LC_ALL=am_ET locale charmap
UTF-8
$ LC_ALL=th_TH locale charmap
TIS-620
But you can just use the explicit charmap, like:
$ LC_ALL=th_TH.UTF-8 locale charmap
UTF-8
$ LC_ALL=am_ET.UTF-8 locale charmap
UTF-8
thanks for working on this,
Pádraig