test.cpp 를 다음과 같이 작성 합니다.
#include <string>
int main( void )
{
std::wstring save_wstring = L"가";
std::cout << save_wstring.size() << std::endl; // ... is not 1 size
return 0;
}
이것을 g++ -g --short-wchar -o test test.cpp 로 컴파일 하면
save_wstring.size()가 1이 아닌게 됩니다.
왜 그럴까요?
참고로 이것을 g++ -g -o test test.cpp 로 컴파일 하면, 사이즈는 1이 나옵니다.
아참, g++ 버전은 4.1.0 이상 입니다.