简体   繁体   English

Jasper Unicode问题与字段参考有关,但与资源包参考无关

[英]Jasper Unicode issue with Field Reference but not Resource Bundle Reference

I am using Jasper Reports to produce PDF reports. 我正在使用Jasper Reports生成PDF报告。 When I have diacriticals in resources ($R expressions), they display fine, but when (in the same report, even in the same TextField element, just swapping the innermost expression) I have Field Reference ($F expression), the diacritical mark is not displayed. 当我在资源中使用变音符($ R表达式)时,它们显示的很好,但是当(在同一报表中,即使在相同的TextField元素中,只是交换最里面的表达式)我有了字段引用($ F表达式)时,变音符不显示。 "Mĕdical" comes out as "Mdical". “医疗”以“医疗”的形式出现。

It can't be font or style (because with the identical font and style, $R expressions display the diacritical without problems). 它不能是字体或样式(因为相同的字体和样式,$ R表达式显示变音符没有问题)。 It can't be encoding (UTF-8, although I've also tried others) for the same reason. 出于相同的原因,它不能进行编码(UTF-8,尽管我也尝试过其他编码)。

I've stepped into the code in the debugger and I know without question that the string being returned to Jasper Reports contains the diacritical character. 我进入了调试器中的代码,毫无疑问,我知道返回给Jasper Reports的字符串包含变音字符。 What could be causing this problem and where can I look to find it? 是什么导致此问题,我在哪里可以找到它?

This turned out to be a two-part problem. 原来这是一个两部分的问题。

  1. I was using a different diacritical character in the $F expression from the $R expression, and the $F diacritical was not supported by my font. 我在$ F表达式中使用的变音符与$ R表达式不同,并且我的字体不支持$ F变音符。

  2. I was HTML-escaping the string that fed to Jasper Reports, and I needed to XML-escape it instead. 我正在用HTML转义提供给Jasper Reports的字符串,而我需要XML转义它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM