JasperReports API: calling JasperCompileManager.compileReport (String) method raised the MalformedByteSequenceException exception

前端 未结 3 1726
囚心锁ツ
囚心锁ツ 2020-12-12 03:55
public void openReport() {

    try {
        HashMap params = new HashMap();
        params.put(\"aapor\", 19);

        JasperReport jasperReport1 = JasperCompileM         


        
3条回答
  •  时光说笑
    2020-12-12 04:20

    When does this exception occur (Compile or Execution?). Usually that problem means that your input IS NOT UTF-8.

    If you are entirely sure that it should be UTF-8 try this: 1. Create a NEW EMPTY file and encode it as UTF-8. 2. Copy the whole text from your old file to the new one. 3. Save the new one and check if it works with the new file. If it does, your old file was not proper UTF-8. 4. If not, post your input file (the jrxml.)

    When I have problems like this I try to find the offending character, a HEX Editor helps.

提交回复
热议问题