Freemarker text encoding error

Zoran Avtarovski <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <C6BB08B0.BD224%[email protected]>
I¹m having trouble displaying Danish text in my forms using the struts tags
and I think it related to an error with how freemarker gets the locale. I¹m
getting a lot of question marks in the text, but if I set the server local
to Danish, all works as expected. Obviously that¹s not a solution as the
other languages also have problems.

For example the s:select tag is incorrectly displaying some Danish text. But
if I go in and edit the freemarker template file and change the label
display from ${} notation to one using <@s.property /> tag it works as
expected.

Here¹s the details 

<@s.property value="%{parameters.label}"/> prints the correct text:

Hvornår (ca.) begyndte de nuværende rygsmerter eller bensmerter (iskias)?

But ${parameters.label?html} prints texts with Œ?¹ substituted for
unsupported characters :

Hvorn?r (ca.) begyndte de nuv?rende rygsmerter eller bensmerter (iskias)?

I tried adding the <#setting locale="da_DK"> setting to the top of the
control header template with no
joy.

I can see one solution is to change all the freemarker template files and
replace ${} with <@s.property/>.

But I¹m sure there has to be a simpler solution.

I¹ve already posted to the struts list and I¹m not getting a lot of love
there, so I was hoping somebody here would recognise what I¹ve done wrong
and point me in the right direction.

Z.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july

_______________________________________________
FreeMarker-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.