On Mon, 3 Dec 2001, Tom Hughes wrote:
> It's completely wrong I would have thought - the encoding layer
> cannot know that a given code point is a digit so it can't possibly
> do string to number conversion.
>
> You need to use the encoding layer to fetch each character and
> then the character set layer to determine what digit it represents.
Right.  And then you need to apply some unified logic to get from this
vector of digits (and other such symbols) to a value.

In other words, I think some sort of library rotuine is the Right Thing
here, it shouldn't pull (directly) off of any vtable.

I'm just having nightmares of subtily different definitions of what a
numeric constant looks like depending on the string encoding, because of
different bits o' code not being quite in sync.  Code duplication bad,
code sharing good.

(The charset layer should still be involved somewhere, because Unicode
(for ex) has a "digit value" property.  This makes, say, aribic numerials
(which don't look at all what what a normal person calls aribic numerals,
BTW) work properly.  (OTOH, it might also do strange things with ex
Hebrew, where the letters are also numbers (Aleph is also 1, Bet is also
2, etc.))

(Damm... when did I become such a Unicode fanatic.  The only language I
acatualy know doesn't even use most of Latin-1.)

        -=- James Mastros
-- 
"In the case of alchemy v chemistry the chemists know whether it will
probably go bang before they try it (and the chemical engineers still duck
anyway)."       -=- Alan Cox



Reply via email to