Codereview request for 4153167: separate between ANSI and OEM code pages on Windows (original) (raw)
Xueming Shen xueming.shen at oracle.com
Mon Feb 13 23:16:21 UTC 2012
- Previous message: Codereview request for 4153167: separate between ANSI and OEM code pages on Windows
- Next message: Codereview request for 4153167: separate between ANSI and OEM code pages on Windows
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 2/13/2012 11:07 AM, Bill Shannon wrote:
Thanks for fixing this!
The webrev is at
http://cr.openjdk.java.net/~sherman/4153167/webrev 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 FILETYPECHAR? 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 <http://en.wikipedia.org/wiki/Parallel_port> interface on IBM PC-compatible <http://en.wikipedia.org/wiki/PC_compatible> computers <http://en.wikipedia.org/wiki/Computer>. It was designed to operate a text printer <http://en.wikipedia.org/wiki/Computer_printer> that used IBM <http://en.wikipedia.org/wiki/IBM>'s 8-bit extended ASCII <http://en.wikipedia.org/wiki/Extended_ASCII> character set <http://en.wikipedia.org/wiki/Character_set>.
-Sherman
Can you detect the case of creating an InputStreamReader using the default encoding, wrapped around the InputStream from System.in 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"! :-)
- Previous message: Codereview request for 4153167: separate between ANSI and OEM code pages on Windows
- Next message: Codereview request for 4153167: separate between ANSI and OEM code pages on Windows
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]