I've got your number! Here's how...

by Michael S. Kaplan, published on 2011/08/22 07:01 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2011/08/22/10198369.aspx

Amul asked me a question via the Contact link:

I am trying to find a solution to get the decimal value to/from Unicode strings.  I have been searching high and low and came across your blog post from a few years back.

My goal is to collate Hindi, Gujarati and Arabic numbers together. (Do warn me if that's a pipe dream :)

I'm not using Windows, so all I have are the ICU libraries from IBM (and I have no idea what MS uses).  I can convert from Unicode characters to decimal numbers but I don't see anything that'll convert back to Unicode characters.

Would you know how Windows handles this issue?


Well, there is good news and really good news and bad news here.

First the good news:

The managed CharUnicodeInfo class has GetDecimalDigitValue, GetDigitValue and GetNumericValue methods that can be used to get the numeric value of any of the numbers.

The three methods are derived from the Numeric_Value and Numeric_Type properties from the Unicode Character Database....

You still have to divine your own "interlaced differentiation", of course.

And the really good news?

The collation support on Windows already does the work to collate them together!

Of course if you aren't using Windows, you can't get that stuff. :-(

Finally the bad news: although I'm sure ICU also wraps this info, I have no idea how. So if you need the answer about ICU then someone else will have to provide it....

Tian on 23 Aug 2011 12:28 AM:

Hello,Michael,I am a Chinese and I have one question,can you do me a favor.It is about CEdit::SetCueBanner.You know that I hanve installed the  Asian language pack in my WinXP,so the banner does not work at all.My question is:is there any way to use CEdit::SetCueBanner in WinXp with Asian language pack installed?

Michael S. Kaplan on 23 Aug 2011 7:17 PM:

Not really related, is it? You should perhaps put it in the Suggestion Box, with info on whether it works in later versions....

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