Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jetty mac encoding to UTF-8

I'm running Jetty on OSX on my dev environment. Currently character encoding seems to be faulti (probably mac-roman), overriding Jetty default. How can I force the encoding to be UTF-8? This problem seems to appear only on OSX, linux/windows works fine.

I'm running Jetty from terminal so eclipse-specific solutions aren't of help.

like image 909
Marcus Avatar asked Nov 27 '25 10:11

Marcus


2 Answers

Apparently I was wrong in blaming Jetty for this problem. The reason was maven and how maven brings in the default encoding java-settings.

Setting this env-variable seemed to solve the problem:

export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8

Answer found from here.

like image 145
Marcus Avatar answered Nov 29 '25 15:11

Marcus


No problem here however we start Jetty from the javaWrapper (and which should not make a difference).

The only parameter I can see making an impact is setting the file.encoding System Property e.g. -Dfile.encoding=UTF-8

EDIT ( our macs locale are set to utf-8 )

like image 33
Bruno Grieder Avatar answered Nov 29 '25 14:11

Bruno Grieder



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!