Boost logo

Boost :

From: Zach Laine (whatwasthataddress_at_[hidden])
Date: 2024-02-29 00:30:15


On Wed, Feb 28, 2024 at 3:26 PM Richard via Boost <boost_at_[hidden]> wrote:
>
> In article <CALOpkJCSm3-YEfhYVuWZG+XPco09LfOodope37QjOn40qGGQ_Q_at_[hidden]> you write:
> >I should have mentioned -- I recently removed the ascii::* parsers,
> >which used is_*() from the C standard library. It included
> >ascii::alnum. I removed them because those is_*() functions are
> >considered just plain wrong by me and lots of other people from SG-16
> >(the committee's Unicode study group).
>
> Is there a link to some discussion about why they are considered
> 'wrong'? Certainly they're correct for ASCII.

Yeah, but if you switch to using Unicode, you have some problems.

https://daniel.haxx.se/blog/2018/01/30/isalnum-is-not-my-friend

For the lazy: the values returned by these functions depends on the
locale. The locale is global state that can be set by anyone, at any
time, and is not concurrency-safe. You can set it, call isalnum(),
and get a locale that is not the one you just set. They're a mess, as
is absolutely everything that depends on locale.

FWIW, there are even locales for EBCDIC that make even your
ASCII-range values wrong.

Zach


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk