This repository was archived by the owner on Jul 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathlocales-currencies-tz.html
More file actions
317 lines (274 loc) · 17.4 KB
/
locales-currencies-tz.html
File metadata and controls
317 lines (274 loc) · 17.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
<emu-clause id="locales-currencies-tz">
<h1>Identification of Locales, Currencies, Time Zones, <del>and</del> Measurement Units<ins>, Numbering Systems, Collations, and Calendars</ins></h1>
<p>
This clause describes the String values used in the ECMAScript 2023 Internationalization API Specification to identify locales, currencies, time zones, <del>and</del> measurement units<ins>, numbering systems, collations, and calendars </ins>.
</p>
<emu-clause id="sec-case-sensitivity-and-case-mapping">
<h1>Case Sensitivity and Case Mapping</h1>
<p>
The String values used to identify locales, currencies, scripts, and time zones are interpreted in an ASCII-case-insensitive manner, treating the code units 0x0041 through 0x005A (corresponding to Unicode characters LATIN CAPITAL LETTER A through LATIN CAPITAL LETTER Z) as equivalent to the corresponding code units 0x0061 through 0x007A (corresponding to Unicode characters LATIN SMALL LETTER A through LATIN SMALL LETTER Z), both inclusive. No other case folding equivalences are applied.
</p>
<emu-note>
For example, *"ß"* (U+00DF) must not match or be mapped to *"SS"* (U+0053, U+0053). *"ı"* (U+0131) must not match or be mapped to *"I"* (U+0049).
</emu-note>
<p>
The <dfn>ASCII-uppercase</dfn> of a String value _S_ is the String value derived from _S_ by replacing each occurrence of an ASCII lowercase letter code unit (0x0061 through 0x007A, inclusive) with the corresponding ASCII uppercase letter code unit (0x0041 through 0x005A, inclusive) while preserving all other code units.
</p>
<p>
The <dfn>ASCII-lowercase</dfn> of a String value _S_ is the String value derived from _S_ by replacing each occurrence of an ASCII uppercase letter code unit (0x0041 through 0x005A, inclusive) with the corresponding ASCII lowercase letter code unit (0x0061 through 0x007A, inclusive) while preserving all other code units.
</p>
<p>
A String value _A_ is an <dfn>ASCII-case-insensitive match</dfn> for String value _B_ if the ASCII-uppercase of _A_ is exactly the same sequence of code units as the ASCII-uppercase of _B_. A sequence of Unicode code points _A_ is an ASCII-case-insensitive match for _B_ if _B_ is an ASCII-case-insensitive match for ! CodePointsToString(_A_).
</p>
</emu-clause>
<emu-clause id="sec-language-tags">
<h1>Language Tags</h1>
<p>...</p>
</emu-clause>
<emu-clause id="sec-currency-codes">
<h1>Currency Codes</h1>
<p>
The ECMAScript 2023 Internationalization API Specification identifies currencies using 3-letter currency codes as defined by ISO 4217. Their canonical form is uppercase.
</p>
<p>
All well-formed 3-letter ISO 4217 currency codes are allowed. However, the set of combinations of currency code and language tag for which localized currency symbols are available is implementation dependent. Where a localized currency symbol is not available, the ISO 4217 currency code is used for formatting.
</p>
<emu-clause id="sec-iswellformedcurrencycode" aoid="IsWellFormedCurrencyCode">
<h1>IsWellFormedCurrencyCode ( _currency_ )</h1>
<p>
The IsWellFormedCurrencyCode abstract operation verifies that the _currency_ argument (which must be a String value) represents a well-formed 3-letter ISO currency code. The following steps are taken:
</p>
<emu-alg>
1. If the length of _currency_ is not 3, return *false*.
1. Let _normalized_ be the ASCII-uppercase of _currency_.
1. If _normalized_ contains any code unit outside of 0x0041 through 0x005A (corresponding to Unicode characters LATIN CAPITAL LETTER A through LATIN CAPITAL LETTER Z), return *false*.
1. Return *true*.
</emu-alg>
</emu-clause>
<ins class="block">
<emu-clause id="sec-availablecanonicalcurrencies" type="implementation-defined abstract operation">
<h1>AvailableCanonicalCurrencies (
): a List of Strings</h1>
<dl class="header">
<dt>description</dt>
<dd>The returned List is ordered as if an Array of the same values had been sorted using %Array.prototype.sort% using *undefined* as _comparefn_, and contains unique, well-formed, and upper case canonicalized 3-letter ISO 4217 currency codes, identifying the currencies for which the implementation provides the functionality of Intl.DisplayNames and Intl.NumberFormat objects.</dd>
</dl>
</emu-clause>
</ins>
</emu-clause>
<emu-clause id="sec-time-zone-names">
<h1>Time Zone Names</h1>
<p>
The ECMAScript 2023 Internationalization API Specification identifies time zones using the Zone and Link names of the IANA Time Zone Database. Their canonical form is the corresponding Zone name in the casing used in the IANA Time Zone Database except as specifically overridden by CanonicalizeTimeZoneName.
</p>
<p>
A conforming implementation must recognize *"UTC"* and all other Zone and Link names (and <strong>only</strong> such names), and use best available current and historical information about their offsets from UTC and their daylight saving time rules in calculations. However, the set of combinations of time zone name and language tag for which localized time zone names are available is implementation dependent.
</p>
<emu-clause id="sec-isvalidtimezonename" aoid="IsValidTimeZoneName">
<h1>IsValidTimeZoneName ( _timeZone_ )</h1>
<p>
The abstract operation IsValidTimeZoneName takes argument _timeZone_, a String value, and verifies that it represents a valid Zone or Link name of the IANA Time Zone Database.
</p>
<emu-alg>
1. If one of the Zone or Link names of the IANA Time Zone Database is an ASCII-case-insensitive match of _timeZone_, return *true*.
1. If _timeZone_ is an ASCII-case-insensitive match of *"UTC"*, return *true*.
1. Return *false*.
</emu-alg>
</emu-clause>
<emu-note>
Any value returned from DefaultTimeZone must be recognized as valid.
</emu-note>
<emu-clause id="sec-canonicalizetimezonename" type="abstract operation">
<h1>
CanonicalizeTimeZoneName (
_timeZone_: a String value that is a valid time zone name as verified by IsValidTimeZoneName,
)
</h1>
<dl class="header">
<dt>description</dt>
<dd>It returns the canonical and case-regularized form of _timeZone_.</dd>
</dl>
<emu-alg>
1. Let _ianaTimeZone_ be the String value of the Zone or Link name of the IANA Time Zone Database that is an ASCII-case-insensitive match of _timeZone_.
1. If _ianaTimeZone_ is a Link name, let _ianaTimeZone_ be the String value of the corresponding Zone name as specified in the file <code>backward</code> of the IANA Time Zone Database.
1. If _ianaTimeZone_ is *"Etc/UTC"* or *"Etc/GMT"*, return *"UTC"*.
1. Return _ianaTimeZone_.
</emu-alg>
</emu-clause>
<emu-clause id="sec-defaulttimezone" aoid="DefaultTimeZone">
<h1>DefaultTimeZone ( )</h1>
<p>
The DefaultTimeZone abstract operation returns a String value representing the valid (<emu-xref href="#sec-isvalidtimezonename"></emu-xref>) and canonicalized (<emu-xref href="#sec-canonicalizetimezonename"></emu-xref>) time zone name for the host environment's current time zone.
</p>
</emu-clause>
<ins class="block">
<emu-clause id="sec-availablecanonicaltimezones" type="implementation-defined abstract operation">
<h1>
AvailableCanonicalTimeZones (
): a List of Strings
</h1>
<dl class="header">
<dt>description</dt>
<dd>The returned List is a sorted List of supported Zone and Link names in the IANA Time Zone Database.</dd>
</dl>
<emu-alg>
1. Let _names_ be a List of all supported Zone and Link names in the IANA Time Zone Database.
1. Let _result_ be a new empty List.
1. For each element _name_ of _names_, do
1. Assert: ! IsValidTimeZoneName( _name_ ) is *true*.
1. Let _canonical_ be ! CanonicalizeTimeZoneName( _name_ ).
1. If _result_ does not contain an element equal to _canonical_, then
1. Append _canonical_ to the end of _result_.
1. Sort _result_ in order as if an Array of the same values had been sorted using %Array.prototype.sort% using *undefined* as _comparefn_.
1. Return _result_.
</emu-alg>
</emu-clause>
</ins>
</emu-clause>
<emu-clause id="sec-measurement-unit-identifiers">
<h1>Measurement Unit Identifiers</h1>
<p>
The ECMAScript 2023 Internationalization API Specification identifies measurement units using a <em>core unit identifier</em> (or equivalently <em>core unit ID</em>) as defined by <a href="https://www.unicode.org/reports/tr35/tr35-general.html#Unit_Identifiers">Unicode Technical Standard #35, Part 2, Section 6.2</a>. Their canonical form is a string containing only Unicode Basic Latin lowercase letters (U+0061 LATIN SMALL LETTER A through U+007A LATIN SMALL LETTER Z) with zero or more medial hyphens (U+002D HYPHEN-MINUS).
</p>
<p>
Only a limited set of core unit identifiers are sanctioned.
Attempting to use an unsanctioned core unit identifier results in a RangeError.
</p>
<emu-clause id="sec-iswellformedunitidentifier" aoid="IsWellFormedUnitIdentifier">
<h1>IsWellFormedUnitIdentifier ( _unitIdentifier_ )</h1>
<p>
The IsWellFormedUnitIdentifier abstract operation verifies that the _unitIdentifier_ argument (which must be a String value) represents a well-formed UTS #35 core unit identifier that is either a sanctioned single unit or a complex unit formed by division of two sanctioned single units. The following steps are taken:
</p>
<emu-alg>
1. If ! IsSanctionedSingleUnitIdentifier(_unitIdentifier_) is *true*, then
1. Return *true*.
1. Let _i_ be StringIndexOf(_unitIdentifier_, *"-per-"*, 0).
1. If _i_ is -1 or StringIndexOf(_unitIdentifier_, *"-per-"*, _i_ + 1) is not -1, then
1. Return *false*.
1. Assert: The five-character substring *"-per-"* occurs exactly once in _unitIdentifier_, at index _i_.
1. Let _numerator_ be the substring of _unitIdentifier_ from 0 to _i_.
1. Let _denominator_ be the substring of _unitIdentifier_ from _i_ + 5.
1. If ! IsSanctionedSingleUnitIdentifier(_numerator_) and ! IsSanctionedSingleUnitIdentifier(_denominator_) are both *true*, then
1. Return *true*.
1. Return *false*.
</emu-alg>
</emu-clause>
<emu-clause id="sec-issanctionedsingleunitidentifier" aoid="IsSanctionedSingleUnitIdentifier" oldids="sec-issanctionedsimpleunitidentifier">
<h1>IsSanctionedSingleUnitIdentifier ( _unitIdentifier_ )</h1>
<p>
The IsSanctionedSingleUnitIdentifier abstract operation verifies that the _unitIdentifier_ argument (which must be a String value) is among the single unit identifiers sanctioned in the current version of the ECMAScript Internationalization API Specification, which are a subset of the Common Locale Data Repository <a href="https://github.com/unicode-org/cldr/blob/maint/maint-38/common/validity/unit.xml">release 38 unit validity data</a>; the list may grow over time. As discussed in UTS #35, a single unit identifier is a core unit identifier that is not composed of multiplication or division of other unit identifiers. The following steps are taken:
</p>
<emu-alg>
1. If _unitIdentifier_ is listed in <emu-xref href="#table-sanctioned-single-unit-identifiers"></emu-xref> below, return *true*.
1. Else, return *false*.
</emu-alg>
<emu-table id="table-sanctioned-single-unit-identifiers" oldids="table-sanctioned-simple-unit-identifiers">
<emu-caption>Single units sanctioned for use in ECMAScript</emu-caption>
<table class="real-table">
<thead>
<tr>
<th>Single Unit Identifier</th>
</tr>
</thead>
<tr><td>acre</td></tr>
<tr><td>bit</td></tr>
<tr><td>byte</td></tr>
<tr><td>celsius</td></tr>
<tr><td>centimeter</td></tr>
<tr><td>day</td></tr>
<tr><td>degree</td></tr>
<tr><td>fahrenheit</td></tr>
<tr><td>fluid-ounce</td></tr>
<tr><td>foot</td></tr>
<tr><td>gallon</td></tr>
<tr><td>gigabit</td></tr>
<tr><td>gigabyte</td></tr>
<tr><td>gram</td></tr>
<tr><td>hectare</td></tr>
<tr><td>hour</td></tr>
<tr><td>inch</td></tr>
<tr><td>kilobit</td></tr>
<tr><td>kilobyte</td></tr>
<tr><td>kilogram</td></tr>
<tr><td>kilometer</td></tr>
<tr><td>liter</td></tr>
<tr><td>megabit</td></tr>
<tr><td>megabyte</td></tr>
<tr><td>meter</td></tr>
<tr><td>mile</td></tr>
<tr><td>mile-scandinavian</td></tr>
<tr><td>milliliter</td></tr>
<tr><td>millimeter</td></tr>
<tr><td>millisecond</td></tr>
<tr><td>minute</td></tr>
<tr><td>month</td></tr>
<tr><td>ounce</td></tr>
<tr><td>percent</td></tr>
<tr><td>petabyte</td></tr>
<tr><td>pound</td></tr>
<tr><td>second</td></tr>
<tr><td>stone</td></tr>
<tr><td>terabit</td></tr>
<tr><td>terabyte</td></tr>
<tr><td>week</td></tr>
<tr><td>yard</td></tr>
<tr><td>year</td></tr>
</table>
</emu-table>
</emu-clause>
<ins class="block">
<emu-clause id="sec-availablecanonicalunits" type="abstract operation">
<h1>AvailableCanonicalUnits (
): a List of Strings</h1>
<dl class="header">
<dt>description</dt>
<dd>The returned List is ordered as if an Array of the same values had been sorted using %Array.prototype.sort% using *undefined* as _comparefn_, and consists of the unique values of simple unit identifiers listed in every row of <emu-xref href="#table-sanctioned-simple-unit-identifiers"></emu-xref>, except the header row.</dd>
</dl>
</emu-clause>
</ins>
</emu-clause>
<ins class="block">
<emu-clause id="sec-numberingsystem-identifiers">
<h1>Numbering System Identifiers</h1>
<p>
The ECMAScript 2023 Internationalization API Specification identifies numbering systems using a <em>numbering system identifier</em> as defined by <a href="https://unicode.org/reports/tr35/tr35-numbers.html#Numbering_Systems">Unicode Technical Standard #35, Part 3, Section 1</a>. Their canonical form is a string containing all lowercase letters.
</p>
<emu-clause id="sec-availablecanonicalnumberingsystems" type="implementation-defined abstract operation">
<h1>AvailableCanonicalNumberingSystems (
): a List of Strings</h1>
<dl class="header">
<dt>description</dt>
<dd>The returned List is ordered as if an Array of the same values had been sorted using %Array.prototype.sort% using *undefined* as _comparefn_, and contains unique numbering systems identifiers identifying the canonical numbering systems for which the implementation provides the functionality of Intl.DateTimeFormat, Intl.NumberFormat, and Intl.RelativeTimeFormat objects. The list must include the Numbering System value of every row of <emu-xref href="#table-numbering-system-digits"></emu-xref>, except the header row.</dd>
</dl>
</emu-clause>
</emu-clause>
<emu-clause id="sec-collation-types">
<h1>Collation Types</h1>
<p>
The ECMAScript 2023 Internationalization API Specification identifies collations using a <em>collation type</em> as defined by <a href="https://unicode.org/reports/tr35/tr35-collation.html#Collation_Types">Unicode Technical Standard #35, Part 5, Section 3.1</a>. Their canonical form is a string containing all lowercase letters with zero or more hyphens.
</p>
<emu-clause id="sec-availablecanonicalcollations" type="implementation-defined abstract operation">
<h1>AvailableCanonicalCollations (
): a List of Strings</h1>
<dl class="header">
<dt>description</dt>
<dd>The returned List is ordered as if an Array of the same values had been sorted using %Array.prototype.sort% using *undefined* as _comparefn_, and contains unique canonical collation types identifying the collations for which the implementation provides the functionality of Intl.Collator objects.</dd>
</dl>
</emu-clause>
</emu-clause>
<emu-clause id="sec-calendar-types">
<h1>Calendar Types</h1>
<p>
The ECMAScript 2023 Internationalization API Specification identifies calendars using a <em>calendar type</em> as defined by <a href="https://unicode.org/reports/tr35/tr35-dates.html#Calendar_Elements">Unicode Technical Standard #35, Part 4, Section 2</a>. Their canonical form is a string containing all lower case letters with zero or more hyphens.
</p>
<emu-clause id="sec-availablecanonicalcalendars" type="implementation-defined abstract operation">
<h1>AvailableCanonicalCalendars (
): a List of Strings</h1>
<dl class="header">
<dt>description</dt>
<dd>The returned List is ordered as if an Array of the same values had been sorted using %Array.prototype.sort% using *undefined* as _comparefn_, and contains unique canonical calendar types identifying the calendars for which the implementation provides the functionality of Intl.DateTimeFormat objects. The list must include *"iso8601"*.</dd>
</dl>
</emu-clause>
</emu-clause>
</ins>
</emu-clause>