0

我想用笔划显示字符 \u0141 即“L”。我已将此 unicode 附加到要在报告中显示的字段中,并且它在 iReport 预览 PDF 中显示良好。但是当我从我的网络应用程序生成相同的报告时,它显示为空白,即该字符未显示在 pdf 中。我正在使用 JasperReports 3.5.3。

4

1 回答 1

0

在 ireport 中使用自定义表达式来解决问题,并在自定义类中编写将 unicode 转换为 text 的逻辑。

public class Unifun {
   public static String convertunitostring(String s) {
      return StringEscapeUtils.unescapeJava(s);
   }
   public static void main(String args[]) {
      System.out.println(convertunitostring("\ufeff\u0110\u1eaf\u0063\u0020\u004c\u1eaf\u0063"));
   }
}
于 2014-07-03T10:21:19.650 回答