[Ecls-list] Codepage problems in Windows' console

Juan Jose Garcia-Ripoll juanjose.garciaripoll at googlemail.com
Sat May 19 08:12:10 UTC 2012


Hi everybody,

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

Juanjo

-- 
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20120519/0c17610e/attachment.html>


More information about the ecl-devel mailing list