News for hackers. Stuff that matters.
Re:A Tale of Two Libcs by masklinn on Saturday September 26, 2020 @06:52AM (#24597817)
> But what the duck? How does that make sense for Chinese?

It doesn't.

> This is bullshit.

Welcome to POSIX locales.

> Great, now isalnum returns true for ä if I'm using de_DE.latin1 or whatever, but is still nonsense for any non-western language.

Technically it's already nonsense for western languages as ISO-8859 is long outdated, and any codepage other than ISO-8859-1 will not fit inside a uchar when decoded from UTF-8. Also there were non-western languages which fit in 8-bit encodings for which isalnum would work fine.

> And the price we pay for that is a messed up pile of garbage that nobody understands and can segfault.

Welcome to POSIX locales. And also C, where not reading and understanding the implication of every word in the specification means you're bad and therefore deserve everything you get. In this case, POSIX clearly specifies that input values outside of EOF or "unsigned char" is UB.

Re:A Tale of Two Libcs by iforgotpassword on Saturday September 26, 2020 @06:59AM (#24597851)
:-) I'm a C dev. Systems mostly but I still hate locales.
Re:A Tale of Two Libcs by viraptor on Saturday September 26, 2020 @09:35AM (#24598729)