이번주 내내 이 함수 때문에 고생을 무지 많이 한거 같다..
역시 man 페이지를 잘 읽어 보지 않은 내 잘못이 크다…
이 함수가 유니코드에서도 정확하게 동작해 주리라는 생각을 왜 하게 되었을까.. 쩝. ㅠㅠ
NAME
isspace – test for a white-space characterSYNOPSIS
#include <ctype.h>int isspace(int c);
DESCRIPTION
The isspace() function shall test whether c is a character of class space in the program’s current locale; see the Base Definitions volume of
IEEE Std 1003.1-2001, Chapter 7, Locale.The c argument is an int, the value of which the application shall ensure is a character representable as an unsigned char or equal to the value of the
macro EOF. If the argument has any other value, the behavior is undefined.RETURN VALUE
The isspace() function shall return non-zero if c is a white-space character; otherwise, it shall return 0.
유니코드에서는 보장할 수 없다네…쩝..
그럼 icu 패키지에 있는 u_isspace 함수는 잘 동작할까?
http://www.opengroup.org/onlinepubs/9699919799/functions/iswspace.html
일단은 표준에 wide char에 대한 정의도 있긴 합니다.
동작은 잘 할듯 합니다..
근데.. 이놈도 locale에 따라 다른 동작을 할 수 있다고 하네요…
일단, 테스트는 내일… 회사 가서.
링크 감사합니다.
C89나 C99 스펙 문서를 잘 읽어 봐야 하는데, 이런 함수가 있는지도 몰랐네요. 그나저나 isspace는 잘 처리도 못하면서 int형 인자는 왜 받는지.. char나 받지..쩝.
iswspace 잘 동작하네요..
팁 고맙습니다.