Re: Codereview request for 6995537: different behavior in iso-2022-jp encoding between jdk131/140/141 and jdk142/5/6/7

2012-02-10 Thread Xueming Shen
On 2/10/2012 12:31 AM, Masayoshi Okutsu wrote: I tend to agree with Sherman that the real problem is the OutputStreamWriter API which isn't good enough to handle various encodings. My understanding is that the charset API was introduced in 1.4 to deal with the limitations of the java.io and o

Re: Codereview request for 6995537: different behavior in iso-2022-jp encoding between jdk131/140/141 and jdk142/5/6/7

2012-02-10 Thread Bill Shannon
If you flush the stream while in the middle of writing a "character", I would expect the results to be undefined, just as if you closed the stream at that point. But at the end of a consistent set of data, I would expect flush to behave like close, but without the actual closing of the stream. M

Re: Codereview request for 6995537: different behavior in iso-2022-jp encoding between jdk131/140/141 and jdk142/5/6/7

2012-02-10 Thread Jason Mehrens
Sherman, My mistake, I missed the fact that flushBuffer does not flush the encoder. I incorrectly thought that write/print caused the encoder to flush and only the direct call to OSW.flush did not. Jason Date: Thu, 9 Feb 2012 11:29:04 -0800 From: xueming.s...@oracle.com To: jason_mehr.

Re: Codereview request for 6995537: different behavior in iso-2022-jp encoding between jdk131/140/141 and jdk142/5/6/7

2012-02-10 Thread Jason Mehrens
Sherman, As a workaround, what about allowing a write of empty string or empty char array to call flushBuffer? If you call PrintStream.print("") then flushBuffer is called on the internal writers. But if you try the same by doing OuputStreamWriter.write("") the flushbuffer call is trapped b

Re: Codereview request for 6995537: different behavior in iso-2022-jp encoding between jdk131/140/141 and jdk142/5/6/7

2012-02-10 Thread Masayoshi Okutsu
I tend to agree with Sherman that the real problem is the OutputStreamWriter API which isn't good enough to handle various encodings. My understanding is that the charset API was introduced in 1.4 to deal with the limitations of the java.io and other encoding handling issues. I still don't th