[Mono-list] conversions
Jonathan Pryor
jonpryor@vt.edu
Wed, 06 Oct 2004 06:57:11 -0400
On Wed, 2004-10-06 at 03:59, Polton, Richard (IT) wrote:
> If the char which is to be converted is 0661, say, then what will be the
> value of the subtraction? Will it be 0661 - 0660 or will it be 0661 -
> 0030? I assume that a literal '0' will always map to 0030 rather than
> cleverly detect the range of digits that the char belongs to.
Oh. Good point. (Why didn't I think of that?) The literal '0' is
mapped to 0030, so you'd get U+0661 - U+0030, which is *way* too big.
So I guess the code is broken. The question is, in what way? :-/
Now the question is: what does Microsoft's implementation do? :-)
Someone will have to throw U+0661 at Microsoft's
Microsoft.VisualBasic.dll and see what the return value (or exception
generated) is. They may require a value between '0' and '9', and all
other "Nd" digits, such as U+0661, generate exceptions.
Alternatively, Microsoft always subtracts from the proper value.
We can do either of these, we just need to know which to do.
- Jon