public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Yeo Kai Wei <yeokaiwei@hotmail.com>
To: cygwin@cygwin.com
Subject: Re: [ERROR] Locale Monetary Symbol Prints Wrongly on Windows : Cygwin
Date: Tue, 14 Mar 2023 09:30:02 +0800	[thread overview]
Message-ID: <PH0PR05MB99185C99F66C3B3CB3B3293DA4BE9@PH0PR05MB9918.namprd05.prod.outlook.com> (raw)
In-Reply-To: <ZA7/wmI5MGFmAPcg@calimero.vinschen.de>

Hi Corinna,

I can't update to 3.5+, I tried reinstalling using the Cygwin setup

Using "uname -a", my current version is 3.4.6-1.x86_64.

I assume 3.5 hasn't been released officially.

May I know where to get the test release?


In the terminal, when I use $LC_MONETARY = "en_ZM.utf-8" locale -ck 
LC_MONETARY

Cygwin replies "-bash: LC_MONETARY: command not found"


Thank you very much.


Kind Regards,

YEO Kai Wei

On 13/3/2023 6:49 pm, Corinna Vinschen wrote:
> On Mar 13 08:40, Yeo Kai Wei via Cygwin wrote:
>> Hi All,
>>
>> May I ask if there's a bug with Cygwin and Windows currency?
> The en_ZM locale isn't yet supported by Cygwin.  This will change with
> Cygwin 3.5.0.  You can install the latest Cygwin test release
> 3.5.0-0.231.g93f70d7849b8 and retry.  You'll get the correct output:
>
> Region: en_AU.utf-8 Currency symbol: $ International currency symbol: AUD
> Region: en_CA.utf-8 Currency symbol: $ International currency symbol: CAD
> Region: en_GB.utf-8 Currency symbol: £ International currency symbol: GBP
> Region: en_US.utf-8 Currency symbol: $ International currency symbol: USD
> Region: en_NZ.utf-8 Currency symbol: $ International currency symbol: NZD
> Region: en_ZM.utf-8 Currency symbol: K International currency symbol: ZMW
>
> Btw., you don't even need a test application, just call
>
>    $ LC_MONETARY="en_ZM.utf-8" locale -ck LC_MONETARY
>
>> The correct answer should be "Region: en_ZM.utf-8 Currency symbol: K
>> International currency symbol: ZMK"
>>
>> Supposedly, the code works on Linux.
>>
>> Is this an issue with Windows?
> We're fetching most locale information from Windows, this includes the
> LC_MONETARY information.  However, the locale support up to Cygwin 3.4.x
> is restricted by an issue in Windows:
>
> Originally, locales were handled in Windows by using so called locale
> identifiers, LCID, 2 byte numbers.  These LCIDs are used by Cygwin
> internally.
>
> In the meantime, Windows switched from LCIDs to locale string
> identifiers following RFC 4646 resp. RFC 5646. Now, the problem is this:
>
> Cygwin didn't yet follow suite, still using LCIDs internally, but
> Windows introduced locales for which no LCID has ever been assigned.
> Asking for the LCID for "en-ZW" returns 0.
>
> For Cygwin 3.5.0, I converted Cygwin to use RFC 5646 locale strings
> internally, too, so the next major version of Cygwin will be able to
> support all locales Windows supports.
>
>>      while (regions[i])
>>      {
>>          setlocale(LC_MONETARY, regions[i]);
> You're not checking for errors here.  If the locale isn't supported,
> setlocale should return NULL...
>
>>          const struct lconv* loc = localeconv();
> ...and the locale information stays unchanged.  As such, if en_ZM isn't
> supported, this call will still fetch the information of the en_NZ.utf-8
> locale.
>
>
> HTH,
> Corinna

  reply	other threads:[~2023-03-14  1:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-13  0:40 Yeo Kai Wei
2023-03-13  5:40 ` Brian Inglis
2023-03-13 10:49 ` Corinna Vinschen
2023-03-14  1:30   ` Yeo Kai Wei [this message]
2023-03-14  3:44     ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2023-03-14  4:20       ` Brian Inglis
2023-03-14 10:17     ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=PH0PR05MB99185C99F66C3B3CB3B3293DA4BE9@PH0PR05MB9918.namprd05.prod.outlook.com \
    --to=yeokaiwei@hotmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).