-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
std.ascii isPunct returns true for several symbols #8419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Feel free to make a pr, or I can. |
Ok, I'll do the PR! |
zig follows this convention, which is inherited by many formats and protocols |
Interesting. So |
If #5019 was accepted you could have a |
That would definitely be a good thing; compliant, not misleading, less confusing. |
Counter-proposal: delete ascii.isPunct and also don't define it in std.os or std.posix |
Yeah, that could be the best option to avoid confusion having multiple isPunct functions in different places. |
As of #12448 this function is deprecated so I think this issue can be closed: Lines 355 to 358 in 99c3578
It will be removed eventually along with the other stuff. |
As @r00ster91 points out, this is now a non-issue. |
It seems this issue was decided without reference to the standard; Wikipedia is not authoritative. According to the 2007 revision of the 1986 standard, there is an unambiguous term for characters which are not control, space, or alphanumeric: special characters. I would eat a hat live on camera if the 2017 revision changed that, but don't care to spend $60 to find out for sure. The C and POSIX function Eliminating a source of ambiguity between Unicode and ASCII was and is a reasonable choice, but it's left the predicates in |
According to https://en.wikipedia.org/wiki/ASCII#Character_set , the following characters are symbols, not punctuation:
It so happens that this is the case in Unicode too. In
std.ascii
, there's noisSymbol
so these characters are covered byisPunct
which differs from both ASCII and Unicode. I have a working version at https://github.com/jecolon/ziglyph/blob/main/src/ascii.zig but don't know if I should make a PR with it or let it be handled via this issue. That version addsisSymbol
, with correspondingsymbol
table andtIndex.Symbol
enum value.The text was updated successfully, but these errors were encountered: