Closed cvengler closed 3 years ago
Hi @emilengler - thanks for the PR :) I hadn't thought of supporting more than ASCII/utf-8 but sure why not.
Should we keep the previous code commented out just next to (or above) your changes?
1) That would make it easy to avoid the extra function calls.
2) I don't know if I'm being paranoid with this, but I was also worried that ctype.h
could be missing on some weird C compiler-systems (embedded: I'm looking at you!).
We could also add a #define and let a macro decide?
I think we should do one of the above though. Any comments on that?
Wow, PR from a cURL contributor - I'm star-struck ;D
2. I don't know if I'm being paranoid with this, but I was also worried that `ctype.h` could be missing on some weird C compiler-systems (embedded: I'm looking at you!).
I feel it is safe to assume that
Interestingly, there is a passage in K&R that is almost identical to part of this commit:
Sounds good to me then - will merge :+1:
Checks like (x >= '0' && x <= '9') are highly dependent on the charset used by the operating system. Fortunately C has some functions that do the checks independently of the charset so we can achieve more portability through it.