POSIX states: The perror() function shall not change the orientation of the standard error stream. However, cygwin perror() function changes the orientation of stderr to byte-oriented mode if stderr is not oriented yet. Simple test case (chkperror.c) attached checks this behavior. Expected result: 0 äöü: Invalid argument 0 äöü 1 äöü: Invalid argument However, cygwin result: 0 äöü: Invalid argument -1 ▒▒▒ -1 äöü: Invalid argument I have made a patch to solve this problem, attached. However, I am not sure that calling _write_r() here is correct manner. I will appreciate if anyone familiar with libc code comment or make suggestions. -- Takashi Yano