mirror of https://github.com/apache/lucene.git
SOLR-7972: Fix VelocityResponseWriter template encoding issue
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1697789 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a65779666d
commit
306d7f4198
|
@ -153,6 +153,9 @@ Bug Fixes
|
|||
* SOLR-7956: There are interrupts on shutdown in places that can cause ChannelAlreadyClosed
|
||||
exceptions which prevents proper closing of transaction logs. (Mark Miller)
|
||||
|
||||
* SOLR-7972: Fix VelocityResponseWriter template encoding issue.
|
||||
Templates must be UTF-8 encoded. (Erik Hatcher)
|
||||
|
||||
Optimizations
|
||||
----------------------
|
||||
|
||||
|
|
|
@ -284,6 +284,8 @@ public class VelocityResponseWriter implements QueryResponseWriter, SolrCoreAwar
|
|||
|
||||
engine.setProperty(RuntimeConstants.RESOURCE_LOADER, StringUtils.join(loaders,','));
|
||||
|
||||
engine.setProperty(RuntimeConstants.INPUT_ENCODING, "UTF-8");
|
||||
|
||||
// bring in any custom properties too
|
||||
engine.init(velocityInitProps);
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
éñçø∂îñg
|
|
@ -92,6 +92,11 @@ public class VelocityResponseWriterTest extends SolrTestCaseJ4 {
|
|||
assertEquals("0", h.query(req("q","*:*", "wt","velocity",VelocityResponseWriter.TEMPLATE,"numFound")));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEncoding() throws Exception {
|
||||
assertEquals("éñçø∂îñg", h.query(req("q","*:*", "wt","velocity",VelocityResponseWriter.TEMPLATE,"encoding")));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMacros() throws Exception {
|
||||
// tests that a macro in a custom macros.vm is visible
|
||||
|
|
Loading…
Reference in New Issue