Getting currency names

by Michael S. Kaplan, published on 2005/10/25 03:01 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2005/10/25/484436.aspx


Warren asked me (via the contact link):

First, I'd like to say I enjoy reading your blog. Second, I've got a question about retrieving currency names. I'd like it if you could answer my question (if the solution is even possible). If it's not possible, maybe you could add a blog entry as to why it was decided not to have this available.

I'm trying to enumerate all of the currency names for a system (I'm using MFC C++), like the second table in the following MSDN page:

http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemglobalizationregioninfoclasstopic.asp

e.g. I would like to programmatically retrieve "Canadian Dollar" from the system. I have no problem getting the ISO symbols, country name, three letter codes (etc) but I can't find a way to get the currency name. It seems like a common thing to list for a country (or it wouldn't be listed in the table on that MSDN page ?!?)

Thanks

Warren

Well, first I would like to day thank you very much. :-)

Second, I have some bad news. There is no currency object that can be used to enumerate currency names. However, currency information can be returned for every locale in Windows, by calling the GetLocaleInfo function with either the LOCALE_SENGCURRNAME or LOCALE_SNATIVECURRNAME LCType values.

 

This post brought to you by "₯" (U+20af, a.k.a. DRACHMA SIGN)


# Mihai on 25 Oct 2005 11:23 AM:

The solution is good enough if you need the currency name in the language matching the currency, or English.
If you need more, you can take a look (and download) the Unicode Common Locale Data Repository (www.unicode.org/cldr).
This will allow one to retrieve the name of the Romanian "Lei" translated into Chinese, for instance.

# Michael S. Kaplan on 25 Oct 2005 11:40 AM:

Of course, I have to shudder a little bit as the lines between internationalization and localization are blurred. :-)

# Maurits [MSFT] on 27 Oct 2005 12:07 AM:

Opposite sides of the same coin...

Think globally, act locally.

# Michael S. Kaplan on 27 Oct 2005 12:16 AM:

I would respectfully disagree.

LOCALIZABILITY and internationalization coexist in people who are good at the job, but localization is an entirely different and specialized knowledge of source and target languages and cultures.

They are opposite sides of two different coins that you would want to have in your collection. But they are also entirely different skill sets that you can be totally awesome in one while knowing a little bit in the other and still be an excellent professional person....

# danah on 28 Oct 2008 5:42 AM:

I would respectfully disagree.

LOCALIZABILITY and internationalization coexist in people who are good at the job, but localization is an entirely different and specialized knowledge of source and target languages and cultures.

They are opposite sides of two different coins that you would want to have in your collection. But they are also entirely different skill sets that you can be totally awesome in one while knowing a little bit in the other and still be an excellent professional person....

# Michael S. Kaplan on 29 Oct 2008 3:02 PM:

<echo> <echo> <echo> <echo>


Please consider a donation to keep this archive running, maintained and free of advertising.
Donate €20 or more to receive an offline copy of the whole archive including all images.

go to newer or older post, or back to index or month or day