Re: Draft JEP: To use UTF-8 as the default charset for the Java virtual machine.

2018-02-22 Thread Alan Bateman
On 21/02/2018 20:50, Uwe Schindler wrote: : Thanks for clarifying! I just wanted to mention this, because those methods are different, so you should at least think about it  These methods were deliberately specified to use UTF-8 and I don't think we should change them (changing them for a

RE: Draft JEP: To use UTF-8 as the default charset for the Java virtual machine.

2018-02-21 Thread Uwe Schindler
Hi Alan, > > The Java 7+ methods in java.nio.file.Files already ignore the default > > charset > and always use UTF-8. How to proceed with those? Should they be changed > to behave to the new mechanisms? I'd suggest to not do this, as its part of > the spec (to use UTF-8) and should not rely on

Re: Draft JEP: To use UTF-8 as the default charset for the Java virtual machine.

2018-02-21 Thread Robert Muir
On Wed, Feb 21, 2018 at 1:16 PM, Xueming Shen wrote: > > Hi Robert, > > Understood a silent replacement might not be the desired behavior in > some use scenarios. Anymore details regarding what "most apps want" > when there is/are malformed/unmappable? It appears the

Re: Draft JEP: To use UTF-8 as the default charset for the Java virtual machine.

2018-02-21 Thread Xueming Shen
On 2/21/18, 6:26 AM, Robert Muir wrote: On Wed, Feb 21, 2018 at 8:55 AM, Alan Bateman wrote: Good progress was made via JDK-8183743 [1] in Java SE 10 to add constructors and methods that take a Charset and eliminate the historical inconsistencies. The issue of legacy

Re: Draft JEP: To use UTF-8 as the default charset for the Java virtual machine.

2018-02-21 Thread Xueming Shen
Hi Volker, Yes, the handing of sun.jnu.encoding will not be changed. It will remain as a read-only/informative system property. sun.jnu.encoding is really an implementation details (as well as file.encoding, though in this JEP file.encoding might be used to provide a mechanism to fallback to

Re: Draft JEP: To use UTF-8 as the default charset for the Java virtual machine.

2018-02-21 Thread Volker Simonis
Hi Sherman, the tricky part is really "sun.jnu.encoding" and how the VM interacts with the underlying OS. You may remember that we had an interesting discussion about this topic some time ago [1]. As far as I understand, the JEP doesn't plan to change the handling of "sun.jnu.encoding". So does

RE: Draft JEP: To use UTF-8 as the default charset for the Java virtual machine.

2018-02-21 Thread Uwe Schindler
Hi, Thanks Alan for the link to this issue about FileReader/Writer! Uwe - Uwe Schindler uschind...@apache.org ASF Member, Apache Lucene PMC / Committer Bremen, Germany http://lucene.apache.org/ > -Original Message- > From: core-libs-dev

Re: Draft JEP: To use UTF-8 as the default charset for the Java virtual machine.

2018-02-21 Thread Robert Muir
On Wed, Feb 21, 2018 at 8:55 AM, Alan Bateman wrote: > Good progress was made via JDK-8183743 [1] in Java SE 10 to add constructors > and methods that take a Charset and eliminate the historical > inconsistencies. The issue of legacy FileReader/FileWriter is linked from

Re: Draft JEP: To use UTF-8 as the default charset for the Java virtual machine.

2018-02-21 Thread Alan Bateman
On 21/02/2018 08:53, Uwe Schindler wrote: : The Java 7+ methods in java.nio.file.Files already ignore the default charset and always use UTF-8. How to proceed with those? Should they be changed to behave to the new mechanisms? I'd suggest to not do this, as its part of the spec (to use UTF-8)

Re: Draft JEP: To use UTF-8 as the default charset for the Java virtual machine.

2018-02-21 Thread Alan Bateman
On 21/02/2018 13:41, Stephen Colebourne wrote: On 21 February 2018 at 13:37, Alan Bateman wrote: The proposal is to eventually get to the point that the default charset cannot be changed. It will take several releases to get there due to the potential compatibility

Re: Draft JEP: To use UTF-8 as the default charset for the Java virtual machine.

2018-02-21 Thread Stephen Colebourne
On 21 February 2018 at 13:37, Alan Bateman wrote: > The proposal is to eventually get to the point that the default charset > cannot be changed. It will take several releases to get there due to the > potential compatibility impact. This seems like a reasonable strategy

Re: Draft JEP: To use UTF-8 as the default charset for the Java virtual machine.

2018-02-21 Thread Alan Bateman
On 21/02/2018 13:19, David Lloyd wrote: I agree with Uwe and Remi; if the default is still changeable, the problem doesn't go away, it simply becomes slightly more insidious. The proposal is to eventually get to the point that the default charset cannot be changed. It will take several

Re: Draft JEP: To use UTF-8 as the default charset for the Java virtual machine.

2018-02-21 Thread David Lloyd
I agree with Uwe and Remi; if the default is still changeable, the problem doesn't go away, it simply becomes slightly more insidious. On Wed, Feb 21, 2018 at 12:31 AM, Xueming Shen wrote: > This draft JEP contains a proposal to use UTF-8 as the default charset for > the

RE: Draft JEP: To use UTF-8 as the default charset for the Java virtual machine.

2018-02-21 Thread Remi Forax
I agree with Uwe, we should deprecate all methods/constructors that relies on the default charset. And we should do that before changing to use UTF-8 by default. Remi On February 21, 2018 8:53:54 AM UTC, Uwe Schindler wrote: >Hi, > >> This draft JEP contains a

RE: Draft JEP: To use UTF-8 as the default charset for the Java virtual machine.

2018-02-21 Thread Uwe Schindler
Hi, > This draft JEP contains a proposal to use UTF-8 as the default charset > for the JVM, so that > APIs that depend on the default charset behave consistently cross all > platforms. > > For more details, please see: > https://bugs.openjdk.java.net/browse/JDK-8187041 Thanks for finally adding