I’m calling Java from the terminal and sending an Arabic string to the main method as a parameter like this:
/path/to/java -Dfile.encoding=UTF-8 -classpath “/path/to/bin” path.to.main “مرحبا” and everything works fine and I receive the String without any encoding problems …
But, I’m facing an encoding problem when doing the same on the server and receiving the String like that “????”
So, can any body tell how to fix this encoding problem on my linux server?
Thanks a lot.
That’s still pretty vague.. you mean ssh into a linux server and running the same command there vs. on a local windows machine? osx? Going on the assumption that you are working on OSX locally and running ssh to get to a linux machine I would look at the terminal settings for your ssh client. It’s likely that it doesn’t support UTF-8 encoding and you’re just seeing the terminal client’s interpretation of characters it doesn’t understand.