Is there a difference between converting a string of ASCII digits to an integer versus a string of non-ASCII digits to an integer?

Harriet Riddle harjitmoe at outlook.com
Mon Dec 14 17:03:36 CST 2020


Roger L Costello via Unicode wrote:
> […]
> 2. The C function atoi() converts a string of digits to a number. I have seen the source code for atoi(). The source code that I saw was dated around the year 2000. Can you point me to the modern source code for atoi()?
>
> /Roger


Here is the implementation from the FreeBSD libc: 
https://github.com/freebsd/freebsd/blob/master/lib/libc/stdlib/strtol.c

(|strtol| and |strtol_l| are defined in that source file.  |atoi| and 
|atoi_l| just wrap them, passing |NULL| for |endptr| and |10| for |base|.)

—Har.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://corp.unicode.org/pipermail/unicode/attachments/20201214/0ada775f/attachment-0001.htm>


More information about the Unicode mailing list