Skip to content

Commit

Permalink
Issue 687 (#689)
Browse files Browse the repository at this point in the history
* issue-687

* issue-687
  • Loading branch information
mnyakushev authored Aug 21, 2024
1 parent de938b7 commit 02ca6b5
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 );
Expand Down

0 comments on commit 02ca6b5

Please sign in to comment.