Changing Locale of a printstream in Java

ConradDoggo :

I'm working on a project in which you can draw lines on a canvas and save it in a textfile with coordinates for each line.

However, when I try to save it with this method, and write it to the textfile, all dots are replaced by commas.

I assume this is due to my language on the PC being European, so I've tried to find a workaround by setting the Locale of the printstream to Locale.US, but without luck.

How can I possibly fix this without changing the language of my entire PC?

ConradDoggo :

Update: I fixed this by changing the Locale in my 'main' method:

Locale.setDefault(new Locale("en", "US"));

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=99428&siteId=1