我正在做TC的本地化工作,想在控制台上打印日文版。

问题描述 投票:-1回答:1

我想在控制台打印日文语言,这样我就可以通过maven命令在Jenkins中运行我的项目,但它总是打印???(请参考截图).我在目标中写了-Dproject.build.sourceEncoding=UTF-8和-Dproject.reporting.outputEncoding=UTF-8,但仍然没有打印。 我在goals中写了-Dproject.build.sourceEncoding=UTF-8和-Dproject.reporting.outputEncoding=UTF-8,但还是没有打印,我也试过用-Dfile.encoding=UTF-8,但没有用,我在surefire插件和pom.xml上的编译器插件中都加了编码,但还是没有用,谁能帮帮我,我到底哪里错了?[目标控制台输出]2

java maven selenium-webdriver automation localization
1个回答
0
投票

你可以打印 UTF-8 字样

String unicodeMessage = "\u7686\u3055\u3093\u3001\u3053\u3093\u306b\u3061\u306f";

PrintStream out = new PrintStream(System.out, true, "UTF-8");
out.println(unicodeMessage);

最新情况:

PrintStream out = new PrintStream(System.out, true, "UTF-8");
out.println("Notification List Header Text is: " + PLClinicalNotificationsHelper.getNotificationsListHeaderText());
© www.soinside.com 2019 - 2024. All rights reserved.