Forums Register Login

Change default character set of JVM

+Pie Number of slices to send: Send
Is there a way to change the default character set of JVM to say, UTF-8?



On Windows
==========
Default Character Set: Cp1252
File Encoding: Cp1252

On Linux
========
Default Character Set: ASCII
File Encoding: ANSI_X3.4-1968


I would like to save on the effort of changing the many lines of code that looks like

to

Thanks,
Kelvin
+Pie Number of slices to send: Send
No, I don't believe this is possible. It may be possible to change the regional settings in your OS instead - however I don't see a way to set it to UTF-8 on Windows. (I only checked quickly; I may have missed something.)

I would recommend that you go ahead and replace your code with calls to a custom method like this:

This will make it much easier to make such changes in the future. As well as shortening up your code.
Don't destroy the earth! That's where I keep all my stuff! Including this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 11451 times.
Similar Threads
Japanese character not read or written correctly
problem while unzipping the non-ascii characters
Bytes displaying for chinese characters
generating valid xml with irish fada
Few Doubts about encoding
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 03:40:57.