Test program:
#include <fcntl.h>
#include <errno.h>
int main()
{
  char buffer;
  int ok;
  do {
    ok = read(0, &buffer, 1);
    printf("\ncode=%d %x errno=%d, ok=%d", buffer, buffer, errno, ok);
  } while (ok > 0);
}

Output:

C:\cygwin\home\Juanjo\src\ecl\win32>chcp 936
Active code page: 936
C:\cygwin\home\Juanjo\src\ecl\win32>echo 亀 | foo.exe
code=-127 ffffff81 errno=0, ok=1
code=119 77 errno=0, ok=1
code=32 20 errno=0, ok=1
code=10 a errno=0, ok=1
code=10 a errno=0, ok=0
C:\cygwin\home\Juanjo\src\ecl\win32>foo.exe
亀
code=-127 ffffff81 errno=22, ok=-1

So it definitely seems that Windows's C library does not allow input ifrom
the console n other codepages?

Juanjo
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list

Reply via email to