Codereview request for 4153167: separate between ANSI and OEM code pages on Windows

Xueming Shen xueming.shen at
Mon Feb 13 23:16:21 UTC 2012

On 2/13/2012 11:07 AM, Bill Shannon wrote:
> Thanks for fixing this!
>> The webrev is at
> You probably don't need to malloc 64 bytes for a string that's
> going to be less than 16 bytes.  And shouldn't you use snprintf
> in any event?
> Unlike Unix, I assume Windows has no way to have multiple "console"
> devices, with stdout and stderr pointing to different devices?
> Is the console the only device that's FILE_TYPE_CHAR?  Are there no
> serial port devices or other devices that are also of that type?

The Windows API doc says "LPT device or a console". The wiki's LPT 
section suggests
it should also use IBM style extended ASCII cs, so I would assume it's 
fine to use the
oem code page, if there is any > LPT usage.
LPT* (Line Print Terminal or Local Print Terminal) is the original, and 
still common, name
of the parallel port <> 
interface on IBM PC-compatible 
<> computers 
<>. It was designed to operate
a text printer <> that used 
IBM <>'s 8-bit extended ASCII 
<> character set 


> Can you detect the case of creating an InputStreamReader using the
> default encoding, wrapped around the InputStream from
> that refers to the console?  If so, it might be good to handle that
> case as well, although at this point I would consider that to be
> "extra credit"!  :-)

More information about the core-libs-dev mailing list