Fix unescape GREL function in javascript mode. Closes #1681.
This commit is contained in:
parent
d271b430ec
commit
87b6aadbad
@ -62,7 +62,7 @@ public class Unescape implements Function {
|
||||
} else if ("csv".equals(mode)) {
|
||||
return StringEscapeUtils.unescapeCsv(s);
|
||||
} else if ("javascript".equals(mode)) {
|
||||
return StringEscapeUtils.escapeEcmaScript(s);
|
||||
return StringEscapeUtils.unescapeEcmaScript(s);
|
||||
} else if ("url".equals(mode)) {
|
||||
try {
|
||||
return URLDecoder.decode(s,"UTF-8");
|
||||
|
@ -177,5 +177,11 @@ public class ToFromConversionTests extends RefineTest {
|
||||
Assert.assertEquals(invoke("escape", Double.parseDouble("1.23"), "url"),"1.23");
|
||||
Assert.assertEquals(invoke("escape", Double.parseDouble("1.23"), "javascript"),"1.23");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnescape() {
|
||||
Assert.assertEquals(invoke("unescape", "Ä", "html"),"Ä");
|
||||
Assert.assertEquals(invoke("unescape", "\\u00C4", "javascript"),"Ä");
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user