Solved Why ascii_isspace() instead of ::isspace()?
-
I've noticed that calls to
::isspace()
have been replaced by calls toascii_isspace()
as defined in qlocale_p.h.Can someone tell me the reasoning behind that? Both implementations seem to do the same thing. I've been googling but all I've found is this.
-
The commit message says it all 'to replace the locale-dependent isspace(3)' - isspace() is locale dependent but a non-locale dependent function was needed.
-
Doesn't that depend on the version of isspace() used?
As far as I know ::isspace(), the one defined in <cctype>, isn't locale-dependent, or am I missing something?
By the way, I'm only asking out of curiosity, so thanks for indulging me. :-)
-
@marcbf said in Why ascii_isspace() instead of ::isspace()?:
isn't locale-dependent, or am I missing something?
http://www.cplusplus.com/reference/cctype/isspace/ says it's locale dependent
-
I see. I must have missed that. I've always worked under the assumption that the regular isspace() only checks in the default C locale and that you should use the version which takes the locale as a parameter to have locale support.