Closed bombledmonk closed 9 years ago
According to wikipedia, it seems legit because 'µ' is the official abbreviation and 'u' is considered as fallback one.
In circumstances in which only the Latin alphabet is available, the prefix can (unofficially) be represented using the letter u as in um for µm, or uF for µF.
To make sure the right unicode character is used, it would be preferable to explicitely use in the code its unicode escape sequence '\u00B5' instead of 'µ' literal and to add a test.
Yes, the official abbreviation is micro
, not u
... My question was more with how javascript and/or web browsers handle non-ascii characters. I simply don't know if this will work well in all cases or if there will be compatibility issues with different browsers or different charsets (locales).
For instance, the omega
symbol is the correct character to use for ohm
but does it work well with javascript? If so, then why doesn't js-quantities also use that? ...and the degree
symbol before F
for degF
, etc...
Non-ASCII characters are not a problem because they are internally handled as Unicode by JavaScript whatever the locale is. Symbol support could be added to the library, they are not mandatory and will not introduce regressions, just additional ways to express units for those interested.
Good to know. I have looked in the past and could not find any authoritative documentation on the subject at the time.
This one line change is fairly self explanatory.