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

Stepan Koltsov commented on VELOCITY-519:
-----------------------------------------

Nathan, EscapeTool does escaping. I need something opposite.

I need ability to insert any Unicode character in template. Any programming 
language, templating language or markup language allows this. Velocity shoud 
too.

Inserting concrete characters is not unescaping.

My templates are stored in encoding that is not Unicode. So it is not possible 
to insert some characters I have to insert (some unicode characters, like em 
dash). In Java I can write: \u2014, in HTML: —. I want to have something 
similar in Velocity.

I think it is bad idea to have special tool to generate characters.

> 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