You could try 

context.put("test", "Wildh\u00FCnherstra\u00DFe 5");

(to make sure that it's not caused by a wrong interpretaion of the 
international chars in the java sources)

I use Velocity in an UTF-8 based web application without any problems...

-----Ursprüngliche Nachricht-----
Von: Achim Weßling [mailto:[EMAIL PROTECTED] 
Gesendet: Montag, 29. Januar 2007 18:16
An: [email protected]
Betreff: encoding problems with velocity 1.4

Hallo,

I've some encoding problems using velocity 1.4. I coded the following:

context.put("test", "Wildhünherstraße 5");

As you can see I use some german-specific-characters.

I use this in the template as follows:

<!-- $test -->
<!-- Wildhühnerstraße 6 -->

The output of the html page looks like this:

<!-- Wildh�nherstra�e 5 -->
<!-- Wildhühnerstraße 6 -->

The html page has the encoding UTF-8. I use the following initialization:

Properties props = loadConfiguration(config);
            
// define Logging
Velocity.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, 
    "org.apache.velocity.runtime.log.SimpleLog4JLogSystem");
Velocity.setProperty("runtime.log.logsystem.log4j.category", logger.getName());
            
Velocity.setProperty("input.encoding", "UTF-8");
Velocity.setProperty("output.encoding", "UTF-8");
Velocity.setProperty("response.encoding", "UTF-8");
            
Velocity.init(props);
logger.info("Velocity initialized!");


Is somebody out there, how can help me? ;-)

Achim

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


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

Reply via email to