From unknown Sat Jun 14 05:12:44 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45871: Incorrect currency symbol used by locale support Resent-From: Guenther Brunthaler Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Thu, 14 Jan 2021 19:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 45871 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: 45871@debbugs.gnu.org X-Debbugs-Original-To: bug-guile@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.161065260416625 (code B ref -1); Thu, 14 Jan 2021 19:31:01 +0000 Received: (at submit) by debbugs.gnu.org; 14 Jan 2021 19:30:04 +0000 Received: from localhost ([127.0.0.1]:39305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l08Jn-0004K1-6v for submit@debbugs.gnu.org; Thu, 14 Jan 2021 14:30:04 -0500 Received: from lists.gnu.org ([209.51.188.17]:46124) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l08A5-00040S-2B for submit@debbugs.gnu.org; Thu, 14 Jan 2021 14:20:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39478) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l08A4-0004e4-Ng for bug-guile@gnu.org; Thu, 14 Jan 2021 14:20:00 -0500 Received: from mout.gmx.net ([212.227.17.21]:59893) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l08A2-00020D-Oc for bug-guile@gnu.org; Thu, 14 Jan 2021 14:20:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1610651995; bh=rBqlOOc16nce8z9UeMrH+MFp8auz++aFwsorbK5zCXc=; h=X-UI-Sender-Class:From:Subject:To:Date; b=iwBH6diFw8l6zpUwn5eVjU9ekrm4WgiEbVRoNqDJ2cGZnVroSm3hLQBeqrHLIA+Wn 58Ct+NT+8tYiH0BGhsMfZF3/AtAwrMWvc6KPEwg6SQWhDtDcUrh67YZ+gncZ78k1+r h6z0fYKYixD/Zxf9k/xmjac75FndOpQA+JEgfRV4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [10.157.38.112] ([77.119.129.143]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mn2WF-1ljxJE0Dh9-00k54o; Thu, 14 Jan 2021 20:19:55 +0100 From: Guenther Brunthaler Message-ID: <1e2c4895-6f2c-49a2-82e9-9e2ff08beb14@gmx.net> Date: Thu, 14 Jan 2021 20:19:54 +0100 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:m8bL4YS3J6M6Oopf1/y0GwewHzzJGh6iK/U3pp1e6CYcg1AfRI+ y/oGgYi+M4tp3+kmuOgR7TLNjRCTDuB4oZwrGtiVgpeJ1d9rGLFl4+4l6YETA/AbpGkSF2z dj9504VdD+fyRQyoAfD3Zhm87GxNULG3yvgl712Oaqa207aAoLvMphPuqJ+nCG0VH+i+4gM RzT9SZ6e/WYyYn8yhzRiA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:+gmm4a57ihM=:HWPP0IkWvr6CgjWHKdLn3r k7oVV76M8TTF34Jwe+7fdYSnIoloGkbHtETVUSYZWZyTb7XBPSEb4Y13teDSSTmRCXy7ejkMr yD/ofRmkbU3SDso/rfAJLRQQLPjGBuLVrZTP+Y+7ypj46h6+JFZRXAVQMgKyZvLw6Yk5htHwx 42zTY5RXIKUgB84L4oBCSK1pxbY7EsIKHYFUFYF4rvTkO4lLiVlqx48qCMrfdZUj8NvfufIwc o/QAnzVc+aFpqDNIpKliYF++eoxK8bmYPZjDNWR0NVyHFyhMdxki5RZboVMAwfJmSt2qDstXe ASpOuiTU6GkTXTK22B24kQqpcuQRIUCTCssxOXgaDZaRlxROSMzz749/kWcvb2q+MhwdTDEoi uGqgCCoQDeJJlfE3OTJrWWJYN8sKan1/fXzwG+cdZG0zwW5JF0ntqHDwwE7HqfvfSth9cBP5K CfB4R5gUT0gyRi4UyVusyzz9/sJtOkax8dkM9e2Ye40Os12SCEAGgOYYVmkUZ8Y4Pdu3PcQ9D h2ATwV6onHYlvD9En4ekIk1+CnMg/hTa861u1Ss/qRMcQHWE2HREEuPV5M/q+3uQzgi3P9p1+ vPTAyKjioiCcv28DB09mDxpYI5EPBbY3bOjTMIMaSvXvW4KjJ7yXSYSd0YT4l0TlTPjn89GsB tG7XtCHzN8FZpIijDcgGq/gc+ZqMAYxZ+pz+hvz7Y2LYiEro3MPzB90/n6C7rHuDX+AQtyv3C P/M6k2Z/TplYvGSjubKR8/zK+Iyfmy2H77jMuyGt2lmWNSZZDEzyqz6zLZIKpl8CE7HuYSfta DrB8ltR5xu1/SLpQ2OYIAHTzDz060E0xxA03r1OmLly8A7/MgumV+nBDqpAkg7nEyZQ3wiWwQ xOmY3yJvvJLyon65eUaA== Received-SPF: pass client-ip=212.227.17.21; envelope-from=gb_about_gnu@gmx.net; helo=mout.gmx.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Mailman-Approved-At: Thu, 14 Jan 2021 14:30:02 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) 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 =3D "de_AT.UTF-8" scheme@(guile-user)> (display (monetary-amount->locale-string +123.456 #f)) (newline) -=E2=82=AC 123,46 A negative amount??? This seems to be the source of the problem: scheme@(guile-user)> (locale-currency-symbol #f) $2 =3D "-=E2=82=AC" (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 '=E2=82=AC' currency_symbol=3D"=E2=82=AC" crncystr=3D"-=E2=82=AC" duo_currency_symbol=3D"=E2=82=AC" 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.