[
https://issues.apache.org/jira/browse/VELOCITY-519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12475897
]
Nathan Bubna commented on VELOCITY-519:
---------------------------------------
The only consensus here is that we should fix the lexer error when \uXXXX
appears in a string definition. This would be Stepan's second attached patch.
And yes, this will allow you to insert tabs, carriage returns and line feeds by
typing *six* characters for each instead of just typing the one tab, CR or LF
character. why do:
#set( $tab = "\u0009" )
which doesn't even work yet, when
#set( $tab = " " )
already works?
> 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
> Fix For: 1.6
>
> Attachments: velocity-unescape-2007-02-24-stepancheg.diff,
> velocity-unescape-only-u-2007-02-24-stepancheg.diff
>
>
> 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]