Message11857

Author otmarhumbel
Recipients amak, jeff.allen, otmarhumbel
Date 2018-03-27.21:24:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1522185895.34.0.467229070634.issue2659@psf.upfronthosting.co.za>
In-reply-to
Content
I was playing with the jdk9+ issues on a separate branch.

If you go to https://github.com/ohumbel/jython/tree/jdk9 and scroll down to the README you can find a table of the different encoding determination methods on some platforms.
To summarize:

 - the discouraged internal encoding() method only has an effect on windows
 - there it returns the 'old' DOS code pages
 - on all other platforms, file.encoding equals to defaultCharset()

So my conclusion was to use file.encoding on non windows, and a subprocess 'cmd /c chcp' on windows.

A possible implementation can be found in this commit: https://github.com/ohumbel/jython/commit/8fdf2c762aa054b7525eaaaf853b4e6a7bd69134

If this sounds reasonable, I would be happy to distill this into a new issue2659 branch and create a pull request.
History
Date User Action Args
2018-03-27 21:24:55otmarhumbelsetmessageid: <1522185895.34.0.467229070634.issue2659@psf.upfronthosting.co.za>
2018-03-27 21:24:55otmarhumbelsetrecipients: + otmarhumbel, amak, jeff.allen
2018-03-27 21:24:55otmarhumbellinkissue2659 messages
2018-03-27 21:24:54otmarhumbelcreate