diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/HugeGraphHubble.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/HugeGraphHubble.java index 5e25ed8c5..e0c208279 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/HugeGraphHubble.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/HugeGraphHubble.java @@ -27,6 +27,9 @@ import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.scheduling.annotation.EnableScheduling; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; + @SpringBootApplication @EnableScheduling @MapperScan("org.apache.hugegraph.mapper") @@ -38,6 +41,8 @@ public static void main(String[] args) { } public static void initEnv() { + Ex.check(Charset.defaultCharset().equals(StandardCharsets.UTF_8), + "Charset must be UTF-8, current:" + Charset.defaultCharset()); String hubbleHomePath = System.getProperty("hubble.home.path"); Ex.check(StringUtils.isNotEmpty(hubbleHomePath), "The system property 'hubble.home.path' must be set"); diff --git a/hugegraph-hubble/hubble-dist/assembly/static/bin/start-hubble.sh b/hugegraph-hubble/hubble-dist/assembly/static/bin/start-hubble.sh index 2626e0a5d..cecdb2435 100644 --- a/hugegraph-hubble/hubble-dist/assembly/static/bin/start-hubble.sh +++ b/hugegraph-hubble/hubble-dist/assembly/static/bin/start-hubble.sh @@ -42,7 +42,7 @@ for jar in "${LIB_PATH}"/*.jar; do class_path=${class_path}:${jar} done -JAVA_OPTS="-Xms512m" +JAVA_OPTS="-Xms512m -Dfile.encoding=UTF-8" JAVA_DEBUG_OPTS="" FOREGROUND="false" diff --git a/hugegraph-hubble/hubble-dist/assembly/travis/download-hugegraph.sh b/hugegraph-hubble/hubble-dist/assembly/travis/download-hugegraph.sh index ac4cf585c..7e9c40eb4 100755 --- a/hugegraph-hubble/hubble-dist/assembly/travis/download-hugegraph.sh +++ b/hugegraph-hubble/hubble-dist/assembly/travis/download-hugegraph.sh @@ -15,6 +15,7 @@ # License for the specific language governing permissions and limitations # under the License. # +export LANG=zh_CN.UTF-8 set -ev if [[ $# -ne 1 ]]; then diff --git a/hugegraph-hubble/hubble-dist/assembly/travis/install-hugegraph-hubble.sh b/hugegraph-hubble/hubble-dist/assembly/travis/install-hugegraph-hubble.sh index 53f37f708..674274560 100755 --- a/hugegraph-hubble/hubble-dist/assembly/travis/install-hugegraph-hubble.sh +++ b/hugegraph-hubble/hubble-dist/assembly/travis/install-hugegraph-hubble.sh @@ -15,6 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # +export LANG=zh_CN.UTF-8 set -ev TRAVIS_DIR=$(dirname "$0") diff --git a/hugegraph-hubble/hubble-dist/assembly/travis/install-hugegraph.sh b/hugegraph-hubble/hubble-dist/assembly/travis/install-hugegraph.sh index 1b2eb1ba5..920968c00 100755 --- a/hugegraph-hubble/hubble-dist/assembly/travis/install-hugegraph.sh +++ b/hugegraph-hubble/hubble-dist/assembly/travis/install-hugegraph.sh @@ -15,6 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # +export LANG=zh_CN.UTF-8 set -ev COMMIT_ID=$1 diff --git a/hugegraph-hubble/hubble-dist/assembly/travis/run-api-test.sh b/hugegraph-hubble/hubble-dist/assembly/travis/run-api-test.sh index 67000fad7..9be2b3227 100755 --- a/hugegraph-hubble/hubble-dist/assembly/travis/run-api-test.sh +++ b/hugegraph-hubble/hubble-dist/assembly/travis/run-api-test.sh @@ -15,6 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # +export LANG=zh_CN.UTF-8 set -ev TRAVIS_DIR="hubble-dist/assembly/travis" diff --git a/hugegraph-hubble/hubble-dist/assembly/travis/start-hubble.sh b/hugegraph-hubble/hubble-dist/assembly/travis/start-hubble.sh index a806a0f60..efbfbd339 100644 --- a/hugegraph-hubble/hubble-dist/assembly/travis/start-hubble.sh +++ b/hugegraph-hubble/hubble-dist/assembly/travis/start-hubble.sh @@ -80,7 +80,7 @@ args=${CONF_PATH}/hugegraph-hubble.properties log=${LOG_PATH}/hugegraph-hubble.log echo -n "starting HugeGraphHubble " -nohup nice -n 0 java -server "${java_opts}" "${agent_opts}" -Dhubble.home.path="${HOME_PATH}" -cp "${class_path}" ${main_class} "${args}" > "${log}" 2>&1 < /dev/null & +nohup nice -n 0 java -server -Dfile.encoding=UTF-8 "${java_opts}" "${agent_opts}" -Dhubble.home.path="${HOME_PATH}" -cp "${class_path}" ${main_class} "${args}" > "${log}" 2>&1 < /dev/null & pid=$! echo ${pid} > "${PID_FILE}"