[ 
https://issues.apache.org/jira/browse/VELOCITY-519?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Will Glass-Husain reopened VELOCITY-519:
----------------------------------------


I don't see this something worth spending time on myself, but I think I'd 
accept a patch to add this in.  

It's a pretty basic functionality, and a fairly isolated change to the java cc 
tokenizing code.  I'd want to see something comprehensive (e.g. supporting \n 
\r as well as unicode) before committing.

It would help Stepan if you could give some use cases describing why this is 
needed and what problems it would solve.

> Java escape sequences should work in Velocity macros
> ----------------------------------------------------
>
>                 Key: VELOCITY-519
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-519
>             Project: Velocity
>          Issue Type: New Feature
>    Affects Versions: 1.5 beta2
>            Reporter: Stepan Koltsov
>
> Following test should work:
> ===
>     public void testJavaEscape() throws Exception {
>         VelocityEngine ve = new VelocityEngine();
>         ve.init();
>         Context context = new VelocityContext();
>         StringWriter writer = new StringWriter();
>         ve.evaluate(context, writer, "test","#set($v = \"\\u0061\")$v");
>         assertEquals("a", writer.toString());
>         writer = new StringWriter();
>         ve.evaluate(context, writer, "test","#set($v = \"\\n\")$v");
>         assertEquals("\n", writer.toString());
>     }
> ===

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to