Location: A review of cardiac cellular electrophysiology models @ 1b3862589abf / dojo-presentation / js / dojo / dijit / tests / i18n / currency.html

Author:
David Nickerson <david.nickerson@gmail.com>
Date:
2021-09-17 15:50:49+12:00
Desc:
tweak html formatting
Permanent Source URI:
https://models.fieldml.org/workspace/a1/rawfile/1b3862589abf79ae9119ee0b5e99a8b785d762e1/dojo-presentation/js/dojo/dijit/tests/i18n/currency.html

Dijit TextBox Globalization Test for Currency

Before start this test, make sure the dojo/cldr/nls contains the data for "zh-cn", "fr-fr", and "ja-jp" and currencies CNY, EGP, EUR, JPY. If not, convert these CLDR data and put them there.

Issues & Comments

Issue #1Fixed

Some browsers like FireFox have a bug on the non-breaking space character (U+00A0, &nbsp; or &#160; or &#xA0; in HTML). They always convert the NBSP character to a normal space (U+0020, &#x20; in HTML) automatically in the following circumstances:

  • Copy text from the page
  • Use innerHTML to get the content of a certain element
  • Use value to get an INPUT element's value

You cannot read a real NBSP character from an INPUT element on these browsers. It causes issues when some formatting data in CLDR contains an NBSP character. For example,

  • Many locales like French use an NBSP character as a group separator in numbers
  • French and Finnish use NBSP characters in their percentage and currency format patterns respectively

So Dojo may generate formatted data with NBSP characters in it but cannot read NBSP charaters from user's input in some browser.

Issue #2Fixed: the CLDR data generator should be fixed by adding code to convert U+200F to "\u200F" in nls JS files.

Most Bidi currency symbols contain an LTR-MARK (U+200F) character at the very beginning. But Firefox ignores it when it is not in any escaping form. This should be a bug of Firefox. For example, click alert('‏'.indexOf('\u+200F')) (there is a U+200F in the empty-looking string):

  • In Firefox, shows "-1" -- no U+200F found
  • In IE & Opera, shows "0" -- the U+200F is found

But if the U+200F is in some escaping form, Firefox will work as well as other browsers. Click alert('\u200F'.indexOf('\u+200F')) to see the same result both in Firefox and IE:

Issue #3Fixed: added a "localeDigit" to the options

Strictly speaking, the data conversion must support non-European number characters in some locales like Arabic and Hindi. For example, ICU formats a number data into Indic number characters by default in the Arabic locale. However, currently Dojo does not support this feature (Dojo uses the default number conversion of the browser).