diff --git a/bin/elasticsearch.in.bat b/bin/elasticsearch.in.bat index 2b8faa6a264..18e7da4ad36 100644 --- a/bin/elasticsearch.in.bat +++ b/bin/elasticsearch.in.bat @@ -79,5 +79,8 @@ REM JAVA_OPTS=%JAVA_OPTS% -XX:HeapDumpPath=$ES_HOME/logs/heapdump.hprof REM Disables explicit GC set JAVA_OPTS=%JAVA_OPTS% -XX:+DisableExplicitGC +REM Ensure UTF-8 encoding by default (e.g. filenames) +set JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF-8 + set ES_CLASSPATH=%ES_CLASSPATH%;%ES_HOME%/lib/${project.build.finalName}.jar;%ES_HOME%/lib/*;%ES_HOME%/lib/sigar/* -set ES_PARAMS=-Delasticsearch -Des-foreground=yes -Des.path.home="%ES_HOME%" \ No newline at end of file +set ES_PARAMS=-Delasticsearch -Des-foreground=yes -Des.path.home="%ES_HOME%" diff --git a/bin/elasticsearch.in.sh b/bin/elasticsearch.in.sh index 633b0e54977..c7b92e144df 100644 --- a/bin/elasticsearch.in.sh +++ b/bin/elasticsearch.in.sh @@ -65,3 +65,6 @@ JAVA_OPTS="$JAVA_OPTS -XX:+HeapDumpOnOutOfMemoryError" # Disables explicit GC JAVA_OPTS="$JAVA_OPTS -XX:+DisableExplicitGC" + +# Ensure UTF-8 encoding by default (e.g. filenames) +JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF-8"