after spending two days reading stuff about documented and undocumented functionality in Microsoft's API and CRT, I have come to the following conclusions:
* In Windows, it is impossible to reasonably use POSIX functions to read/write text from the console without letting the console do some translation for you.
* Moreover, POSIX's functions do not work, because read() and write() may actually read or write more bytes from the buffer thant you would want, precisely due to this "clever" translation.
* This all renders the CRT unusable, and as stated in a MSDN blog from Windows, one should stick to the Console read and write operations and forget about C entirely.
Well, I have coded a prototype of a Lisp stream for the console. ECL now has code that will detect whether the input/output/error channels are consoles and wrap them around with these streams. Moreover, it will also detect the current codepage and use it as external format for the stream.
All this is pretty much experimental and I need your help testing it. Please report problems.
BTW, as usual, all this is only available in git/CVS