This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

CharToOemBuff in fhandler_console.cc


On my system (Win2K), the call to CharToOemBuff in
fhandler_console::write_normal in the CVS sources is changing graphic
characters such as the solid block ('\333') into other incorrect characters
such as a capital U.

Changing WriteFile to use 'src' rather than 'buf' in that function corrects
the problem.

The short example program below should output four solid blocks, but it
doesn't; instead, it outputs a block, a 'U', a block, and another 'U'.  Is
anyone else seeing this behavior?  What is the reason behind the call to
CharToOemBuff?  Can/should it be removed safely for all systems?  Do I have
something set up incorrectly that is causing the OEM translation to be
wrong?

Brad Town

PS  "uname -s" gives "CYGWIN_NT-5.0 DECATUR 1.1.5(0.29/3/2) 2000-10-16 15:31
i686 unknown".

--- cut here ---
#include <windows.h>
#include <stdio.h>

int main()
{
    DWORD dw;

    ::WriteConsole(::GetStdHandle(STD_OUTPUT_HANDLE), "\333", 1, &dw, 0);
    putchar('\333'); fflush(stdout);
    ::WriteConsole(::GetStdHandle(STD_OUTPUT_HANDLE), "\333", 1, &dw, 0);
    putchar('\333'); fflush(stdout);

    return 0;
}
--- cut here ---

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]