From 02ca6b545f1867c29162ec4096bb1fa05ebb98ac Mon Sep 17 00:00:00 2001 From: mnyakushev <35864341+mnyakushev@users.noreply.github.com> Date: Wed, 21 Aug 2024 14:27:00 +0300 Subject: [PATCH] Issue 687 (#689) * issue-687 * issue-687 --- .../template/velocity/cache/XDocReportEntryResourceLoader.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/template/fr.opensagres.xdocreport.template.velocity/src/main/java/fr/opensagres/xdocreport/template/velocity/cache/XDocReportEntryResourceLoader.java b/template/fr.opensagres.xdocreport.template.velocity/src/main/java/fr/opensagres/xdocreport/template/velocity/cache/XDocReportEntryResourceLoader.java index ab2fc1973..1b0da972c 100644 --- a/template/fr.opensagres.xdocreport.template.velocity/src/main/java/fr/opensagres/xdocreport/template/velocity/cache/XDocReportEntryResourceLoader.java +++ b/template/fr.opensagres.xdocreport.template.velocity/src/main/java/fr/opensagres/xdocreport/template/velocity/cache/XDocReportEntryResourceLoader.java @@ -28,6 +28,7 @@ import java.io.InputStreamReader; import java.io.Reader; import java.io.UnsupportedEncodingException; +import java.nio.charset.Charset; import org.apache.velocity.exception.ResourceNotFoundException; import org.apache.velocity.runtime.RuntimeServices; @@ -76,7 +77,7 @@ public Reader getResourceReader(String source, String encoding) throws ResourceN InputStream inputStream = cacheInfo.getInputStream(); if ( inputStream != null ) { - return new InputStreamReader(inputStream); + return encoding != null ? new InputStreamReader(inputStream, Charset.forName(encoding)) : new InputStreamReader(inputStream); } } throw new ResourceNotFoundException( "Cannot find input stream for the entry with source=" + source );