GNU bug report logs - #45871
Incorrect currency symbol used by locale support

Previous Next

Package: guile;

Reported by: Guenther Brunthaler <gb_about_gnu <at> gmx.net>

Date: Thu, 14 Jan 2021 19:31:01 UTC

Severity: normal

To reply to this bug, email your comments to 45871 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#45871; Package guile. (Thu, 14 Jan 2021 19:31:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Guenther Brunthaler <gb_about_gnu <at> gmx.net>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Thu, 14 Jan 2021 19:31:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Guenther Brunthaler <gb_about_gnu <at> gmx.net>
To: bug-guile <at> gnu.org
Subject: Incorrect currency symbol used by locale support
Date: Thu, 14 Jan 2021 20:19:54 +0100
The (locale-currency-symbol) procedure uses the wrong locale setting,
which effects the formatting of monetary amounts:

scheme@(guile-user)> (use-modules (ice-9 i18n))
scheme@(guile-user)> (setlocale LC_ALL "")
$3 = "de_AT.UTF-8"
scheme@(guile-user)> (display (monetary-amount->locale-string +123.456
#f)) (newline)
-€ 123,46

A negative amount???

This seems to be the source of the problem:

scheme@(guile-user)> (locale-currency-symbol #f)
$2 = "-€"

(Note if your e-mail agent cannot display the currency symbol correctly:
The symbol ought to be displayed as the EUR-sign.)

Obviously, the implementation uses the "crncystr" setting:

$ locale -kc LC_MONETARY | grep -E '€'
currency_symbol="€"
crncystr="-€"
duo_currency_symbol="€"

Problem resolution: The implementation should use the "currency_symbol"
setting rather than the "crncystr" setting.

Alternatively, the "crncystr" can be used, but then the first character
should be interpreted as defined by the POSIX standard, i. e. as a mode
indicator and not as part of the actual currency symbol.




This bug report was last modified 3 years and 348 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.