3 ms·
Yes. If the problem was trying to parse ASCII consistently that would be the right solution. My response was to OPs moving the goal post to "portably parsing A
by avar 8y ago
Yes. If the problem was trying to parse ASCII consistently that would be the right solution.
My response was to OPs moving the goal post to "portably parsing ASCII" in response to his suggested replacement for a C library function not being portable on non-ASCII systems, which make no sense.
- jstimpfle 8y agoI explicitly wrote "or whatever test" as a comment to the code snippet, and obviously the test was not the point of my comment. Anyway I think most programming languages nowadays have their source encoding specified as UTF-8 or at least something ASCII-like, so ('A' <= c && c <= 'Z') is in fact what I would likely write, and using isalpha() would technically be a bug just as well.