Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial: use unicode name/code for currencies in note #942

Merged
merged 9 commits into from
Mar 18, 2021

Conversation

marcoscaceres
Copy link
Member

@marcoscaceres marcoscaceres commented Mar 16, 2021

Begins to address w3c/i18n-activity#1044


Preview | Diff

Copy link
Collaborator

@ianbjacobs ianbjacobs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @marcoscaceres,

It feels to me like we should review and harmonize the guidance in
this section. As written I think there are some contradictions between
the ISO4217 and non-ISO sections.

Here's an overall flow (with some questions inline). Let me know what you think.

INPUT:

  1. An [[ISO4217]] well-formed 3-letter
    alphabetic code (i.e., the numeric codes are not supported).

  2. Current implementations also allow the use of well-formed
    currency codes that are not part of the official [[ISO4217]] list
    (e.g., XBT, XRP, etc.).

  3. In more detail: User agents implementing this specification
    enforce [[ISO4217]]'s 3-letter codes format via ECMAScript’s isWellFormedCurrencyCode
    abstract operation, which is invoked as part of the check and
    canonicalize amount algorithm. When a code does not adhere to
    the [[ISO4217]] defined format, a {{RangeError}} is thrown.

DISPLAY:

  1. Browsers that display the 3-letter currency codes generally do so
    using uppercase.

  2. User agents MAY format the currency to adhere to OS
    conventions (e.g., for localization purposes).

    OBSERVATION: This one overrides the points below so I am suggesting
    to put it first.

  3. Currency symbols

    • Browsers MAY display a currency symbol instead of a currency code.
      (e.g., "USD" is shown as U+0024 Dollar Sign ($), "GBP" is U+00A3
      Pound Sign (£), and the non-standard "XBT" could be
      shown as U+0243 Latin Capital Letter B with Stroke (Ƀ))

    • However, the meaning of currency symbols may be ambiguous, so
      user agents SHOULD display currency codes.

      QUESTION: Should they only do that when there is ambiguity?
      QUESTION: Should they not display the currency symbol at all,
      or should they display the currency code along with the
      symbol?

    • The set of combinations of currency code for which localized
      currency symbols are available is implementation dependent.

    • When a currency symbol is not available, user agent MAY
      MAY use U+00A4 (¤).

ADDITIONAL NOTES:

  • Efforts are underway at ISO to account for digital currencies,
    which may result in an update to the [[ISO4217]] registry or an
    entirely new registry. The community expects this will resolve
    ambiguities that have crept in through the use of non-standard
    3-letter codes; for example, does "BTC" refer to Bitcoin or to a
    future Bhutan currency? At the time of publication, it remains
    unclear what form this evolution will take, or even the time frame
    in which the work will be completed. The W3C Web Payments Working
    Group is liaising with ISO so that, in the future, revisions to
    this specification remain compatible with relevant ISO registries.

@marcoscaceres
Copy link
Member Author

Browsers MAY display a currency symbol instead of a currency code.

We probably don't want to recommend this at all.

QUESTION: Should they only do that when there is ambiguity?

No, they SHOULD always do it - otherwise it would get really confusing.

QUESTION: Should they not display the currency symbol at all,
or should they display the currency code along with the
symbol?

That's a call for UX team - and it may be locale dependent. Thus, it's not our (the WG's/Spec's) call. We can only point out what the pitfalls are (the note).

The additional note seems good. I'll update.

@marcoscaceres
Copy link
Member Author

The additional note seems good. I'll update.

Never mind :) it's the same.

@marcoscaceres
Copy link
Member Author

Browsers that display the 3-letter currency codes generally do so using uppercase.

Note that we only say that the canonical form as it relates to the currency member. We don't say anything about how it should be shown: that's a UA/OS decision, not a spec decision.

@marcoscaceres
Copy link
Member Author

@ianbjacobs, rereading you comments, and questions aside, I think the updated prose addresses your comments... or at least, can you help me understand more specifically where it doesn't.

I think there might be a misunderstanding in that there are no "ISO4217 and non-ISO sections." Let me clarify: any three letter combination is valid irrespective of ISO4217, as isWellFormedCurrencyCode doesn't care if a currency code is ISO4217 or not. Thus, saying "{"currency": "XXX"}" or "{"currency": "XBT"}" for that matter is totally valid, even though it's not part of ISO4217.

index.html Show resolved Hide resolved
@marcoscaceres marcoscaceres merged commit 1cbf910 into gh-pages Mar 18, 2021
@marcoscaceres marcoscaceres deleted the currencies branch March 18, 2021 23:42
@ianbjacobs
Copy link
Collaborator

Hi @marcoscaceres,

At the 15 April 2021 WPWG call it was suggested to add an example of a 2-character currency symbol (just to make the point that not all currency symbols are single Unicode characters). One suggestion was to use PLN / zł.

A concrete editorial proposal is to change

(e.g., "USD" is shown as U+0024 Dollar Sign ($), "GBP" is U+00A3 Pound Sign (£), and the non-standard "XBT" could be shown as U+0243 Latin Capital Letter B with Stroke (Ƀ)).

to

(e.g., "USD" is shown as U+0024 Dollar Sign ($), "GBP" is shown as U+00A3 Pound Sign (£), "PLN" is shown as U+007A U+0142 Złoty (zł), and the non-standard "XBT" could be shown as U+0243 Latin Capital Letter B with Stroke (Ƀ)).

cc @aphillips, @r12a

@marcoscaceres
Copy link
Member Author

Updated spec to include Złoty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants