Christoph Dalitz wrote:

On Thu, 11 Sep 2003 20:51:24 +0200
Manfred Spraul <[EMAIL PROTECTED]> wrote:

- OemToChar() and CharToOem() convert all console input/output. In the long run this might be the better solution, if it works entirely without user intervention. I'm not sure if it's possible to get all corner cases right.

I do not think that it is possible to handle all cases automatically.
Even restricting the conversion to input/output on stdin/stdout will fail in
some circumstances; eg. with the command "psql < script.sql" when the
script has been written with a windows editor (notepad, emacs or whatever).

It would be very hard to get right. Perhaps something like isatty(), except that it's probably called GetHandleIsConsoleFlag() or something like that, followed by a check of the code page. But I didn't find a suitable function yet.


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
   (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to