tre icon indicating copy to clipboard operation
tre copied to clipboard

tab treated as printable character on Windows

Open kalibera opened this issue 8 years ago • 0 comments

The tab character (\t) is treated as printable ([:print:]) on Windows, even in the "C" locale. This is a bug (in violation with POSIX at least) and it happens when TRE_WCHAR is defined. It happens because iswprint(L'\t') returns true on all locales, including the "C" locale. On Unix, \tseems to be treated as non-printable in all locales (certainly all I checked). Note that isprint('\t') on Windows in "C" locale returns false, so using isprint() would have been fine. isprint('\t') returns true on Windows in some other locales, at least CP1252, which is surprising too, but maybe permissible. This has worked around in R which uses TRE.

kalibera avatar Dec 14 '17 13:12 kalibera