encoding problem in Param
Aleksey Shipilev
shade at redhat.com
Mon Mar 6 18:21:44 UTC 2017
Hi, Martijn,
On 03/03/2017 01:32 PM, Martijn Hoekstra wrote:
> The problem manifests here:
> https://github.com/martijnhoekstra/numparsers/blob/master/src/main/scala/ValidShortBenchmarks.scala#L17
>
> That weird looking 1 is a full width 1, +uFF11. The source file is UTF8 and
> my platform default encoding is cp1252.
>
> The maintainer of sbt-jmh suggested I'd ask here.
>
> How should I let JMH know what encoding to use?
Reproduced in local integration test with LC_ALL=C.
The problem comes from JMH internals: it uses the text file to pass benchmark
configuration from benchmark generator (at compile time) to benchmark runner (at
run time). That file contains param values. Writing and reading that file back
in non-UTF encoding garbles param values.
There is no workaround, except accepting UTF-8 as default platform encoding, or
somehow put -Dfile.encoding=... all around. I was unsuccessful, though.
Submitted:
https://bugs.openjdk.java.net/browse/CODETOOLS-7901910
The fix I tried today seems way too intrusive. Let me see if I can make it saner.
Thanks,
-Aleksey
More information about the jmh-dev
mailing list