Re: console output in 8.4.12 on windows
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: console output in 8.4.12 on windows

From: Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net>
Date: Fri Dec 30 2005 - 03:02:35 CET

Hi David,

David Gravereaux writes:
> static BOOL
> writeConsoleBytes(
> [...]
> sscanf(Tcl_DStringValue(&dstr), "cp%d", &codepage);

This should do error checking, in case the programmer has set
something like Latin-9, thinking s/he is on Unix.

> SetConsoleCP(codepage);

This is unnecessary. SetConsoleCP() is only for input. You want to
use SetConsoleCP() for reading the console and SetConsoleOutputCP()
for writing.

> SetConsoleOutputCP(codepage);

benny
Received on Tue Jan 3 03:09:43 2006