This is the mail archive of the cygwin 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]
Other format: [Raw text]

Re: cygwin + GetConsoleOutputCP

Am 20.03.2011 20:13, schrieb Charles Wilson:

Note that this autodetect, if it works, assumes that the console's CP is
the input file's CP.  Fair enough -- and it's an overridable default
anyway.  However, I wonder if, in cygwin-1.7, we actually can/should use
the "console codepage" in ANY way.  Here's the code:

#elif defined (WIN32) || defined(__CYGWIN__)

/* Erwin Waterlander */

unsigned short query_con_codepage(void) {
    return((unsigned short)GetConsoleOutputCP());

Or if instead, on cygwin, we should use some other mechanism (locale
settings?) to determine the correct default "input" codepage.

On cygwin, GetConsoleOutputCP is largely irrelevant and is actually *not* the console's "codepage" for cygwin programs.
Therefore, defined (WIN32) and defined (__CYGWIN__) should be split and either setlocale or nl_langinfo should be used.


Problem reports:
Unsubscribe info:

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