perl-unicode

Re: should \d match *all* the digits?

1999-08-11 01:35:17
Daniel Yacob <dmulholl(_at_)cs(_dot_)indiana(_dot_)edu> writes:
on \d+ and feed it to atoi() meaningfully?

I seem to remember atoi as "ASCII-to-Integer" but my man pages are not 
confirming this.  ANSI C would certainly choke on a UTF8 string in this case.

Which is why you need the 'tr' in Larry's version.

Basically, can you do a tr///
on \d+ and feed it to atoi() meaningfully?

Replacing occurances of atoi with an internal "utoi" (UTF8-to-Ineteger or
Unicode-to-Integer as you like), if feasible, might be in order then.  This
would also open the doors to (at least) integer aritmetic in Perl for the
other Nd characters (mixed script math -fun! :-)

/Daniel
-- 
Nick Ing-Simmons <nik(_at_)tiuk(_dot_)ti(_dot_)com>
Via, but not speaking for: Texas Instruments Ltd.

<Prev in Thread] Current Thread [Next in Thread>