We are running into problems caused by the bug described here: https://bugs.java.com/bugdatabase/view_bug?bug_id=6183404
I have already implemented a fix using a custom charset to fix the incorrect mappings.
However this still does not fix the problem for one Java application we are using, as that is hard-coded to use standard "GBK" charset.
Is there any way using java.nio.charset.spi.CharsetProvider to override existing, standard charsets?
Based on this code in
Charset, it doesn’t look like you can override the standardProvider since it gets searched before any additional ones.If the application stores the charset name in a field, you could do something nasty with reflection to change it before the application starts up.