开发者

Currency code symbols overview? [closed]

开发者 https://www.devze.com 2023-03-23 09:15 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.

Closed 8 years ago.

Improve this question

Simple problem, actually. I need an overview of Unicode/HTML Character entity code for all the curren开发者_开发技巧cies that are in use. The use is very simple: a list of exchange rates. And yes, for Kazachstan I could just display the text "KZT". say "Kazakhstani tenge" or even use "теңге" or "teñge" but I need to show "₸" instead.

Hey, there it is! :-)

Okay, now I need to know the list for all other currency symbols in HTML! Wikipedia provides a good list, but is this a complete list? Is it correct? And what are their codes for HTML usage?


Take a look at this site. Select "Currency Symbols" to see a list of all available currency symbols. To display the majority of them in HTML, you'll have to use the &#x.... syntax, as they don't have a specific HTML entity code.


Unicode has a category for currency symbols: "Sc", and then process the Unicode Character database for code points in that category.

There is a single block of currency symbols, but various currency symbols (including "$" and "£", latter is Pound sign, in the block there is a separate Lira sign) were encoded before this block was created.

(Also, if the currency's symbol is recently adopted – like that new IRP sign – it might not be in Unicode yet.)

Finally, glyph inclusion in common typefaces is another issue…


For a list of what Unicode specifically supports, you can take a look into the code chart. However, that is missing all currency without a special symbol (and $, £ and maybe a few others) or multiple letters (e.g. ლ, лв, Sh.So., etc.). So I guess the Wikipedia list is more exhaustive than the Unicode Standard in that regard.

As for inclusion in HTML, most of them are text. Simply include them directly (assuming that you use Unicode), you can even copy it from Wikipedia. If your document character set isn't Unicode, then change that, ASAP. In the meantime you can use the usual &#x<code point value>; escape mechanism.

Note however, that there is rarely a need of conveying all the world's currencies in their native abbreviated form to the reader. Also some more obscure ones may not be in the fonts the reader has installed. Bear in mind that many people worldwide are still on Windows XP which has horrible Unicode coverage in its fonts (compared to more recent operating systems).

I have no clue what you're building there, but using the ISO codes for the currency and additionally a symbol where appropriate (i.e. for more commonly-used ones) sounds more reasonable to me. Generally the locales you need to support will be happy to see ₪ instead of ILS, but don't expect to support the whole world equally – that's just a cost nightmare. You don't provide translations in every language of the world, either, do you?

0

精彩评论

暂无评论...
验证码 换一张
取 消