You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Zoran Avtarovski <zo...@sparecreative.com> on 2009/08/26 04:26:09 UTC

Freemarker Text Encoding Error

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 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.

Please, please help. As at the rate I¹m going I won¹t be needing a haircut
for a while.

Z.

RE: Freemarker Text Encoding Error

Posted by Martin Gainty <mg...@hotmail.com>.
good call

/dziekuje/
Martin Gainty 
______________________________________________ 
Jogi és Bizalmassági kinyilatkoztatás
 Ez az
üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
ezen üzenet tartalma miatt.







> Date: Thu, 27 Aug 2009 11:32:18 +1000
> Subject: Re: Freemarker Text Encoding Error
> From: zoran@sparecreative.com
> To: user@struts.apache.org
> 
> I guess you can, but I was a little reluctant to introduce the freemarker
> servlet mapping at the web.xml level as the configuration is handled
> internally by struts and I didn’t really want to run into any issues down
> the line.
> 
> I guess I could have also looked at the tomcat configuration and specified
> the charset there. But I’m more comfortable just introducing the page
> attribute to all my page fragments.
> 
> Z.
> > 
> > 
> > this is good information zoran!
> > 
> > can we specify contentType="text/html;charset=UTF-8" thru init-params?
> > 
> > <servlet>
> > <servlet-name>freemarker</servlet-name>
> >     <servlet-class>freemarker.ext.servlet.FreemarkerServlet</servlet-class>
> >     
> >     <!-- FreemarkerServlet settings: -->
> >     <init-param>
> >       <param-name>ContentType</param-name>
> >       <param-value>text/html</param-value>
> >     </init-param>
> >     <!-- FreeMarker settings: -->
> >       <param-name>default_encoding</param-name>
> >       <param-value>ISO-8859-1</param-value>
> >     </init-param>
> > <servlet>
> > <servlet-mapping>
> >  <servlet-name>freemarker</servlet-name>
> >  <url-pattern>*.ftl</url-pattern>
> > </servlet-mapping>reprised from FreeMarkerServlet documentation at
> > http://struts.apache.org/2.1.6/docs/tutoriallesson04-03.html
> > 
> > /dziekuje/
> > Martin Gainty 
> > ______________________________________________
> > Jogi és Bizalmassági kinyilatkoztatás
> >  Ez az
> > üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
> > jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
> > készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
> > semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
> > könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
> > ezen üzenet tartalma miatt.
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> >> > Date: Thu, 27 Aug 2009 10:17:03 +1000
> >> > Subject: Re: Freemarker Text Encoding Error
> >> > From: zoran@sparecreative.com
> >> > To: user@struts.apache.org; musachy@gmail.com;
> >> freemarker-user@lists.sourceforge.net; ddekany@freemail.hu
> >> > 
> >> > Apologies in advance for the cross post, but it saves on typing.
> >> > 
> >> > I found that the solution was simple in the end. While testing various
> >> > options I noticed I had one page that worked. In identifying the difference
> >> > between that and the others there was a difference in the content jspf for
> >> > that page, it had a <%@ page contentType="text/html;charset=UTF-8"
> >> > language="java"%> while the others didn’t.
> >> > 
> >> > I thought there was no longer a need for these in JSP fragments, the main
> >> > JSP page has one as does the sitemesh decorator. But obviously I was wrong.
> >> > 
> >> > So thanks again for your help guys.
> >> > 
> >> > Z.
> >> > 
> >>> > > 
> >>> > > It is good to post here, but for tricky stuff like this, you have a
> >>> > > better chance with them. Also if you find the solution, please let us
> >>> > > know.
> >>> > > 
> >>> > > musachy
> >>> > > 
> >>> > > On Tue, Aug 25, 2009 at 10:38 PM, Zoran
> >>> > > Avtarovski<zo...@sparecreative.com> wrote:
> >>>>> > >> > I knew somebody would say that. I was too lazy to subscribe and I
> half
> >>>>> > >> > expected them to ask on the struts list.
> >>>>> > >> >
> >>>>> > >> > Thanks Musachy, I’ll subscribe and post now. I guess I was hoping
> others
> >>>>> > >> > might have experienced a similar problem.
> >>>>> > >> >
> >>>>> > >> > Z.
> >>>>> > >> >
> >>>>> > >> > did you try asking the FreeMarker guys?
> >>>>> > >> >
> >>>>> > >> > On Tue, Aug 25, 2009 at 7:26 PM, Zoran
> >>>>> > >> > Avtarovski<zo...@sparecreative.com> wrote:
> >>>>>>> > >>> >> 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 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.
> >>>>>>> > >>> >>
> >>>>>>> > >>> >> Please, please help. As at the rate I¹m going I won¹t be
> >>>>>>> needing a
> >>>>> > >>> haircut
> >>>>>>> > >>> >> for a while.
> >>>>>>> > >>> >>
> >>>>>>> > >>> >> Z.
> >>>>>>> > >>> >>
> >>>>> > >> >
> >>>>> > >> >
> >>>>> > >> >
> >>> > > 
> >>> > > 
> >> > 
> > 
> > _________________________________________________________________
> > Get back to school stuff for them and cashback for you.
> > http://www.bing.com/cashback?form=MSHYCB&publ=WLHMTAG&crea=TEXT_MSHYCB_BackToS
> > chool_Cashback_BTSCashback_1x1
> 

_________________________________________________________________
Get back to school stuff for them and cashback for you.
http://www.bing.com/cashback?form=MSHYCB&publ=WLHMTAG&crea=TEXT_MSHYCB_BackToSchool_Cashback_BTSCashback_1x1

Re: [FreeMarker-user] Freemarker Text Encoding Error

Posted by Daniel Dekany <dd...@freemail.hu>.
Thursday, August 27, 2009, 2:45:52 PM, Martin Gainty wrote:

> so the template is the ultimate arbiter for encoding the output

No, it isn't at all. If the ContentType init-param of
FreemarkerServlet specifies the charset then that will be the output
encoding, end of story. The template only has the last word regarding
the encoding of itself, i.e., of the template file, which is not to be
confused with the output the template generates. The encoding of the
template file is just used as the *default* encoding of the output.

> thank you for this comprehensive explanation
>
> Martin Gainty 
> ______________________________________________ 
> Jogi és Bizalmassági kinyilatkoztatás
>
> Ez az üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor
> kérjük, hogy jelentse azt nekünk vissza. Semmiféle továbbítása vagy
> másolatának készítése nem megengedett.  Ez az üzenet csak ismeret
> cserét szolgál és semmiféle jogi alkalmazhatósága sincs.  Mivel az
> electronikus üzenetek könnyen megváltoztathatóak, ezért minket semmi
> felelöség nem terhelhet ezen üzenet tartalma miatt.
>
>
>
>
>
>
>> Date: Thu, 27 Aug 2009 13:16:42 +0200
>> From: ddekany@freemail.hu
>> To: mgainty@hotmail.com
>> CC: user@struts.apache.org; musachy@gmail.com; freemarker-user@lists.sourceforge.net
>> Subject: Re: Freemarker Text Encoding Error
>> 
>> Thursday, August 27, 2009, 2:57:39 AM, Martin Gainty wrote:
>> 
>> > this is good information zoran!
>> >
>> > can we specify contentType="text/html;charset=UTF-8" thru init-params?
>> 
>> Zoran talks about JSP stuff (<%@ page ...%>), so the FreemarkerSerlvet
>> config should be irrelevant there.
>> 
>> As of the pages generated by the FreemarkerSerlvet, in principle the
>> "default_encoding" init-param is for specifying the encoding of the
>> template file (not of the output), and the "ContentType" init-param
>> specifies the MIME-type and the encoding of the output. BUT, in the
>> case of FreemarkerServlet, if the "ContentType" doesn't specify the
>> encoding (i.e., it's not like "text/html; charset=SOMETHING", but like
>> "text/html") then the encoding of the template file is used for
>> encoding the output as well. So in the below quoted example both the
>> template encoding and the output encoding is ISO-8859-1 (except for
>> the templates that explicitly override that with <#ftl
>> encoding="SOMETHING-DIFFERENT">).
>> 
>> > <servlet>
>> > <servlet-name>freemarker</servlet-name>
>> > 
>> > <servlet-class>freemarker.ext.servlet.FreemarkerServlet</servlet-class>
>> > 
>> > <!-- FreemarkerServlet settings: -->
>> > <init-param>
>> > <param-name>ContentType</param-name>
>> > <param-value>text/html</param-value>
>> > </init-param> 
>> > <!-- FreeMarker settings: -->
>> > <param-name>default_encoding</param-name>
>> > <param-value>ISO-8859-1</param-value>
>> > </init-param>
>> > <servlet>
>> > <servlet-mapping>
>> > <servlet-name>freemarker</servlet-name>
>> > <url-pattern>*.ftl</url-pattern>
>> > </servlet-mapping>
>> > reprised from FreeMarkerServlet documentation at
>> > http://struts.apache.org/2.1.6/docs/tutoriallesson04-03.html
>> >
>> > /dziekuje/
>> > Martin Gainty 
>> > ______________________________________________ 
>> > Jogi és Bizalmassági kinyilatkoztatás
>> > 
>> > Ez az üzenet bizalmas. Ha nem ön az akinek szánva volt, akkor
>> > kérjük, hogy jelentse azt nekünk vissza. Semmiféle továbbítása vagy
>> > másolatának készítése nem megengedett. Ez az üzenet csak ismeret
>> > cserét szolgál és semmiféle jogi alkalmazhatósága sincs. Mivel az
>> > electronikus üzenetek könnyen megváltoztathatóak, ezért minket semmi
>> > felelöség nem terhelhet ezen üzenet tartalma miatt.
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >> Date: Thu, 27 Aug 2009 10:17:03 +1000
>> >> Subject: Re: Freemarker Text Encoding Error
>> >> From: zoran@sparecreative.com
>> >> To: user@struts.apache.org; musachy@gmail.com; freemarker-user@lists.sourceforge.net; ddekany@freemail.hu
>> >> 
>> >> Apologies in advance for the cross post, but it saves on typing.
>> >> 
>> >> I found that the solution was simple in the end. While testing various
>> >> options I noticed I had one page that worked. In identifying the difference
>> >> between that and the others there was a difference in the content jspf for
>> >> that page, it had a <%@ page contentType="text/html;charset=UTF-8"
>> >> language="java"%> while the others didn't.
>> >> 
>> >> I thought there was no longer a need for these in JSP fragments, the main
>> >> JSP page has one as does the sitemesh decorator. But obviously I was wrong.
>> >> 
>> >> So thanks again for your help guys.
>> >> 
>> >> Z.
>> >> 
>> >> > 
>> >> > It is good to post here, but for tricky stuff like this, you have a
>> >> > better chance with them. Also if you find the solution, please let us
>> >> > know.
>> >> > 
>> >> > musachy
>> >> > 
>> >> > On Tue, Aug 25, 2009 at 10:38 PM, Zoran
>> >> > Avtarovski<zo...@sparecreative.com> wrote:
>> >> >> > I knew somebody would say that. I was too lazy to subscribe and I half
>> >> >> > expected them to ask on the struts list.
>> >> >> >
>> >> >> > Thanks Musachy, I'll subscribe and post now. I guess I was hoping others
>> >> >> > might have experienced a similar problem.
>> >> >> >
>> >> >> > Z.
>> >> >> >
>> >> >> > did you try asking the FreeMarker guys?
>> >> >> >
>> >> >> > On Tue, Aug 25, 2009 at 7:26 PM, Zoran
>> >> >> > Avtarovski<zo...@sparecreative.com> wrote:
>> >> >>> >> 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 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.
>> >> >>> >>
>> >> >>> >> Please, please help. As at the rate Iąm going I wonąt be needing a
>> >> >>> haircut
>> >> >>> >> for a while.
>> >> >>> >>
>> >> >>> >> Z.
>> >> >>> >>
>> >> >> >
>> >> >> >
>> >> >> >
>> >> > 
>> >> > 
>> >> 
>> >
>> > Get back to school stuff for them and cashback for you. Try BingT now.
>> -- 
>> Best regards,
>> Daniel Dekany
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
>
> HotmailR is up to 70% faster. Now good news travels really fast. Try it now.
-- 
Best regards,
 Daniel Dekany


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Freemarker Text Encoding Error

Posted by Martin Gainty <mg...@hotmail.com>.
so the template is the ultimate arbiter for encoding the output
thank you for this comprehensive explanation

Martin Gainty 
______________________________________________ 
Jogi és Bizalmassági kinyilatkoztatás

Ez az
üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
ezen üzenet tartalma miatt.






> Date: Thu, 27 Aug 2009 13:16:42 +0200
> From: ddekany@freemail.hu
> To: mgainty@hotmail.com
> CC: user@struts.apache.org; musachy@gmail.com; freemarker-user@lists.sourceforge.net
> Subject: Re: Freemarker Text Encoding Error
> 
> Thursday, August 27, 2009, 2:57:39 AM, Martin Gainty wrote:
> 
> > this is good information zoran!
> >
> > can we specify contentType="text/html;charset=UTF-8" thru init-params?
> 
> Zoran talks about JSP stuff (<%@ page ...%>), so the FreemarkerSerlvet
> config should be irrelevant there.
> 
> As of the pages generated by the FreemarkerSerlvet, in principle the
> "default_encoding" init-param is for specifying the encoding of the
> template file (not of the output), and the "ContentType" init-param
> specifies the MIME-type and the encoding of the output. BUT, in the
> case of FreemarkerServlet, if the "ContentType" doesn't specify the
> encoding (i.e., it's not like "text/html; charset=SOMETHING", but like
> "text/html") then the encoding of the template file is used for
> encoding the output as well. So in the below quoted example both the
> template encoding and the output encoding is ISO-8859-1 (except for
> the templates that explicitly override that with <#ftl
> encoding="SOMETHING-DIFFERENT">).
> 
> > <servlet>
> > <servlet-name>freemarker</servlet-name>
> >    
> > <servlet-class>freemarker.ext.servlet.FreemarkerServlet</servlet-class>
> >     
> >     <!-- FreemarkerServlet settings: -->
> >     <init-param>
> >       <param-name>ContentType</param-name>
> >       <param-value>text/html</param-value>
> >     </init-param>    
> >     <!-- FreeMarker settings: -->
> >       <param-name>default_encoding</param-name>
> >       <param-value>ISO-8859-1</param-value>
> >     </init-param>
> > <servlet>
> > <servlet-mapping>
> >  <servlet-name>freemarker</servlet-name>
> >  <url-pattern>*.ftl</url-pattern>
> > </servlet-mapping>
> > reprised from FreeMarkerServlet documentation at
> > http://struts.apache.org/2.1.6/docs/tutoriallesson04-03.html
> >
> > /dziekuje/
> > Martin Gainty 
> > ______________________________________________ 
> > Jogi és Bizalmassági kinyilatkoztatás
> >  
> > Ez az üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor
> > kérjük, hogy jelentse azt nekünk vissza. Semmiféle továbbítása vagy
> > másolatának készítése nem megengedett.  Ez az üzenet csak ismeret
> > cserét szolgál és semmiféle jogi alkalmazhatósága sincs.  Mivel az
> > electronikus üzenetek könnyen megváltoztathatóak, ezért minket semmi
> > felelöség nem terhelhet ezen üzenet tartalma miatt.
> >
> >
> >
> >
> >
> >
> >
> >> Date: Thu, 27 Aug 2009 10:17:03 +1000
> >> Subject: Re: Freemarker Text Encoding Error
> >> From: zoran@sparecreative.com
> >> To: user@struts.apache.org; musachy@gmail.com; freemarker-user@lists.sourceforge.net; ddekany@freemail.hu
> >> 
> >> Apologies in advance for the cross post, but it saves on typing.
> >> 
> >> I found that the solution was simple in the end. While testing various
> >> options I noticed I had one page that worked. In identifying the difference
> >> between that and the others there was a difference in the content jspf for
> >> that page, it had a <%@ page contentType="text/html;charset=UTF-8"
> >> language="java"%> while the others didn't.
> >> 
> >> I thought there was no longer a need for these in JSP fragments, the main
> >> JSP page has one as does the sitemesh decorator. But obviously I was wrong.
> >> 
> >> So thanks again for your help guys.
> >> 
> >> Z.
> >> 
> >> > 
> >> > It is good to post here, but for tricky stuff like this, you have a
> >> > better chance with them. Also if you find the solution, please let us
> >> > know.
> >> > 
> >> > musachy
> >> > 
> >> > On Tue, Aug 25, 2009 at 10:38 PM, Zoran
> >> > Avtarovski<zo...@sparecreative.com> wrote:
> >> >> > I knew somebody would say that. I was too lazy to subscribe and I half
> >> >> > expected them to ask on the struts list.
> >> >> >
> >> >> > Thanks Musachy, I'll subscribe and post now. I guess I was hoping others
> >> >> > might have experienced a similar problem.
> >> >> >
> >> >> > Z.
> >> >> >
> >> >> > did you try asking the FreeMarker guys?
> >> >> >
> >> >> > On Tue, Aug 25, 2009 at 7:26 PM, Zoran
> >> >> > Avtarovski<zo...@sparecreative.com> wrote:
> >> >>> >> 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 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.
> >> >>> >>
> >> >>> >> Please, please help. As at the rate Iąm going I wonąt be needing a
> >> >>> haircut
> >> >>> >> for a while.
> >> >>> >>
> >> >>> >> Z.
> >> >>> >>
> >> >> >
> >> >> >
> >> >> >
> >> > 
> >> > 
> >> 
> >
> > Get back to school stuff for them and cashback for you. Try BingT now.
> -- 
> Best regards,
>  Daniel Dekany
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

_________________________________________________________________
HotmailR is up to 70% faster. Now good news travels really fast. 
http://windowslive.com/online/hotmail?ocid=PID23391::T:WLMTAGL:ON:WL:en-US:WM_HYGN_faster:082009

Re: Freemarker Text Encoding Error

Posted by Daniel Dekany <dd...@freemail.hu>.
Thursday, August 27, 2009, 2:57:39 AM, Martin Gainty wrote:

> this is good information zoran!
>
> can we specify contentType="text/html;charset=UTF-8" thru init-params?

Zoran talks about JSP stuff (<%@ page ...%>), so the FreemarkerSerlvet
config should be irrelevant there.

As of the pages generated by the FreemarkerSerlvet, in principle the
"default_encoding" init-param is for specifying the encoding of the
template file (not of the output), and the "ContentType" init-param
specifies the MIME-type and the encoding of the output. BUT, in the
case of FreemarkerServlet, if the "ContentType" doesn't specify the
encoding (i.e., it's not like "text/html; charset=SOMETHING", but like
"text/html") then the encoding of the template file is used for
encoding the output as well. So in the below quoted example both the
template encoding and the output encoding is ISO-8859-1 (except for
the templates that explicitly override that with <#ftl
encoding="SOMETHING-DIFFERENT">).

> <servlet>
> <servlet-name>freemarker</servlet-name>
>    
> <servlet-class>freemarker.ext.servlet.FreemarkerServlet</servlet-class>
>     
>     <!-- FreemarkerServlet settings: -->
>     <init-param>
>       <param-name>ContentType</param-name>
>       <param-value>text/html</param-value>
>     </init-param>    
>     <!-- FreeMarker settings: -->
>       <param-name>default_encoding</param-name>
>       <param-value>ISO-8859-1</param-value>
>     </init-param>
> <servlet>
> <servlet-mapping>
>  <servlet-name>freemarker</servlet-name>
>  <url-pattern>*.ftl</url-pattern>
> </servlet-mapping>
> reprised from FreeMarkerServlet documentation at
> http://struts.apache.org/2.1.6/docs/tutoriallesson04-03.html
>
> /dziekuje/
> Martin Gainty 
> ______________________________________________ 
> Jogi és Bizalmassági kinyilatkoztatás
>  
> Ez az üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor
> kérjük, hogy jelentse azt nekünk vissza. Semmiféle továbbítása vagy
> másolatának készítése nem megengedett.  Ez az üzenet csak ismeret
> cserét szolgál és semmiféle jogi alkalmazhatósága sincs.  Mivel az
> electronikus üzenetek könnyen megváltoztathatóak, ezért minket semmi
> felelöség nem terhelhet ezen üzenet tartalma miatt.
>
>
>
>
>
>
>
>> Date: Thu, 27 Aug 2009 10:17:03 +1000
>> Subject: Re: Freemarker Text Encoding Error
>> From: zoran@sparecreative.com
>> To: user@struts.apache.org; musachy@gmail.com; freemarker-user@lists.sourceforge.net; ddekany@freemail.hu
>> 
>> Apologies in advance for the cross post, but it saves on typing.
>> 
>> I found that the solution was simple in the end. While testing various
>> options I noticed I had one page that worked. In identifying the difference
>> between that and the others there was a difference in the content jspf for
>> that page, it had a <%@ page contentType="text/html;charset=UTF-8"
>> language="java"%> while the others didn’t.
>> 
>> I thought there was no longer a need for these in JSP fragments, the main
>> JSP page has one as does the sitemesh decorator. But obviously I was wrong.
>> 
>> So thanks again for your help guys.
>> 
>> Z.
>> 
>> > 
>> > It is good to post here, but for tricky stuff like this, you have a
>> > better chance with them. Also if you find the solution, please let us
>> > know.
>> > 
>> > musachy
>> > 
>> > On Tue, Aug 25, 2009 at 10:38 PM, Zoran
>> > Avtarovski<zo...@sparecreative.com> wrote:
>> >> > I knew somebody would say that. I was too lazy to subscribe and I half
>> >> > expected them to ask on the struts list.
>> >> >
>> >> > Thanks Musachy, I’ll subscribe and post now. I guess I was hoping others
>> >> > might have experienced a similar problem.
>> >> >
>> >> > Z.
>> >> >
>> >> > did you try asking the FreeMarker guys?
>> >> >
>> >> > On Tue, Aug 25, 2009 at 7:26 PM, Zoran
>> >> > Avtarovski<zo...@sparecreative.com> wrote:
>> >>> >> 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 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.
>> >>> >>
>> >>> >> Please, please help. As at the rate Iąm going I wonąt be needing a
>> >>> haircut
>> >>> >> for a while.
>> >>> >>
>> >>> >> Z.
>> >>> >>
>> >> >
>> >> >
>> >> >
>> > 
>> > 
>> 
>
> Get back to school stuff for them and cashback for you. Try Bing™ now.
-- 
Best regards,
 Daniel Dekany


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Freemarker Text Encoding Error

Posted by Zoran Avtarovski <zo...@sparecreative.com>.
I guess you can, but I was a little reluctant to introduce the freemarker
servlet mapping at the web.xml level as the configuration is handled
internally by struts and I didn’t really want to run into any issues down
the line.

I guess I could have also looked at the tomcat configuration and specified
the charset there. But I’m more comfortable just introducing the page
attribute to all my page fragments.

Z.
> 
> 
> this is good information zoran!
> 
> can we specify contentType="text/html;charset=UTF-8" thru init-params?
> 
> <servlet>
> <servlet-name>freemarker</servlet-name>
>     <servlet-class>freemarker.ext.servlet.FreemarkerServlet</servlet-class>
>     
>     <!-- FreemarkerServlet settings: -->
>     <init-param>
>       <param-name>ContentType</param-name>
>       <param-value>text/html</param-value>
>     </init-param>
>     <!-- FreeMarker settings: -->
>       <param-name>default_encoding</param-name>
>       <param-value>ISO-8859-1</param-value>
>     </init-param>
> <servlet>
> <servlet-mapping>
>  <servlet-name>freemarker</servlet-name>
>  <url-pattern>*.ftl</url-pattern>
> </servlet-mapping>reprised from FreeMarkerServlet documentation at
> http://struts.apache.org/2.1.6/docs/tutoriallesson04-03.html
> 
> /dziekuje/
> Martin Gainty 
> ______________________________________________
> Jogi és Bizalmassági kinyilatkoztatás
>  Ez az
> üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
> jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
> készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
> semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
> könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
> ezen üzenet tartalma miatt.
> 
> 
> 
> 
> 
> 
> 
>> > Date: Thu, 27 Aug 2009 10:17:03 +1000
>> > Subject: Re: Freemarker Text Encoding Error
>> > From: zoran@sparecreative.com
>> > To: user@struts.apache.org; musachy@gmail.com;
>> freemarker-user@lists.sourceforge.net; ddekany@freemail.hu
>> > 
>> > Apologies in advance for the cross post, but it saves on typing.
>> > 
>> > I found that the solution was simple in the end. While testing various
>> > options I noticed I had one page that worked. In identifying the difference
>> > between that and the others there was a difference in the content jspf for
>> > that page, it had a <%@ page contentType="text/html;charset=UTF-8"
>> > language="java"%> while the others didn’t.
>> > 
>> > I thought there was no longer a need for these in JSP fragments, the main
>> > JSP page has one as does the sitemesh decorator. But obviously I was wrong.
>> > 
>> > So thanks again for your help guys.
>> > 
>> > Z.
>> > 
>>> > > 
>>> > > It is good to post here, but for tricky stuff like this, you have a
>>> > > better chance with them. Also if you find the solution, please let us
>>> > > know.
>>> > > 
>>> > > musachy
>>> > > 
>>> > > On Tue, Aug 25, 2009 at 10:38 PM, Zoran
>>> > > Avtarovski<zo...@sparecreative.com> wrote:
>>>>> > >> > I knew somebody would say that. I was too lazy to subscribe and I
half
>>>>> > >> > expected them to ask on the struts list.
>>>>> > >> >
>>>>> > >> > Thanks Musachy, I’ll subscribe and post now. I guess I was hoping
others
>>>>> > >> > might have experienced a similar problem.
>>>>> > >> >
>>>>> > >> > Z.
>>>>> > >> >
>>>>> > >> > did you try asking the FreeMarker guys?
>>>>> > >> >
>>>>> > >> > On Tue, Aug 25, 2009 at 7:26 PM, Zoran
>>>>> > >> > Avtarovski<zo...@sparecreative.com> wrote:
>>>>>>> > >>> >> 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 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.
>>>>>>> > >>> >>
>>>>>>> > >>> >> Please, please help. As at the rate I¹m going I won¹t be
>>>>>>> needing a
>>>>> > >>> haircut
>>>>>>> > >>> >> for a while.
>>>>>>> > >>> >>
>>>>>>> > >>> >> Z.
>>>>>>> > >>> >>
>>>>> > >> >
>>>>> > >> >
>>>>> > >> >
>>> > > 
>>> > > 
>> > 
> 
> _________________________________________________________________
> Get back to school stuff for them and cashback for you.
> http://www.bing.com/cashback?form=MSHYCB&publ=WLHMTAG&crea=TEXT_MSHYCB_BackToS
> chool_Cashback_BTSCashback_1x1


RE: Freemarker Text Encoding Error

Posted by Martin Gainty <mg...@hotmail.com>.
this is good information zoran!

can we specify contentType="text/html;charset=UTF-8" thru init-params?

<servlet>
<servlet-name>freemarker</servlet-name>
    <servlet-class>freemarker.ext.servlet.FreemarkerServlet</servlet-class>
    
    <!-- FreemarkerServlet settings: -->
    <init-param>
      <param-name>ContentType</param-name>
      <param-value>text/html</param-value>
    </init-param>    
    <!-- FreeMarker settings: -->
      <param-name>default_encoding</param-name>
      <param-value>ISO-8859-1</param-value>
    </init-param>
<servlet>
<servlet-mapping>
	<servlet-name>freemarker</servlet-name>
	<url-pattern>*.ftl</url-pattern>
</servlet-mapping>reprised from FreeMarkerServlet documentation at
http://struts.apache.org/2.1.6/docs/tutoriallesson04-03.html

/dziekuje/
Martin Gainty 
______________________________________________ 
Jogi és Bizalmassági kinyilatkoztatás
 Ez az
üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
ezen üzenet tartalma miatt.







> Date: Thu, 27 Aug 2009 10:17:03 +1000
> Subject: Re: Freemarker Text Encoding Error
> From: zoran@sparecreative.com
> To: user@struts.apache.org; musachy@gmail.com; freemarker-user@lists.sourceforge.net; ddekany@freemail.hu
> 
> Apologies in advance for the cross post, but it saves on typing.
> 
> I found that the solution was simple in the end. While testing various
> options I noticed I had one page that worked. In identifying the difference
> between that and the others there was a difference in the content jspf for
> that page, it had a <%@ page contentType="text/html;charset=UTF-8"
> language="java"%> while the others didn’t.
> 
> I thought there was no longer a need for these in JSP fragments, the main
> JSP page has one as does the sitemesh decorator. But obviously I was wrong.
> 
> So thanks again for your help guys.
> 
> Z.
> 
> > 
> > It is good to post here, but for tricky stuff like this, you have a
> > better chance with them. Also if you find the solution, please let us
> > know.
> > 
> > musachy
> > 
> > On Tue, Aug 25, 2009 at 10:38 PM, Zoran
> > Avtarovski<zo...@sparecreative.com> wrote:
> >> > I knew somebody would say that. I was too lazy to subscribe and I half
> >> > expected them to ask on the struts list.
> >> >
> >> > Thanks Musachy, I’ll subscribe and post now. I guess I was hoping others
> >> > might have experienced a similar problem.
> >> >
> >> > Z.
> >> >
> >> > did you try asking the FreeMarker guys?
> >> >
> >> > On Tue, Aug 25, 2009 at 7:26 PM, Zoran
> >> > Avtarovski<zo...@sparecreative.com> wrote:
> >>> >> 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 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.
> >>> >>
> >>> >> Please, please help. As at the rate I¹m going I won¹t be needing a
> >>> haircut
> >>> >> for a while.
> >>> >>
> >>> >> Z.
> >>> >>
> >> >
> >> >
> >> >
> > 
> > 
> 

_________________________________________________________________
Get back to school stuff for them and cashback for you.
http://www.bing.com/cashback?form=MSHYCB&publ=WLHMTAG&crea=TEXT_MSHYCB_BackToSchool_Cashback_BTSCashback_1x1

Re: Freemarker Text Encoding Error

Posted by Zoran Avtarovski <zo...@sparecreative.com>.
Apologies in advance for the cross post, but it saves on typing.

I found that the solution was simple in the end. While testing various
options I noticed I had one page that worked. In identifying the difference
between that and the others there was a difference in the content jspf for
that page, it had a <%@ page contentType="text/html;charset=UTF-8"
language="java"%> while the others didn’t.

I thought there was no longer a need for these in JSP fragments, the main
JSP page has one as does the sitemesh decorator. But obviously I was wrong.

So thanks again for your help guys.

Z.

> 
> It is good to post here, but for tricky stuff like this, you have a
> better chance with them. Also if you find the solution, please let us
> know.
> 
> musachy
> 
> On Tue, Aug 25, 2009 at 10:38 PM, Zoran
> Avtarovski<zo...@sparecreative.com> wrote:
>> > I knew somebody would say that. I was too lazy to subscribe and I half
>> > expected them to ask on the struts list.
>> >
>> > Thanks Musachy, I’ll subscribe and post now. I guess I was hoping others
>> > might have experienced a similar problem.
>> >
>> > Z.
>> >
>> > did you try asking the FreeMarker guys?
>> >
>> > On Tue, Aug 25, 2009 at 7:26 PM, Zoran
>> > Avtarovski<zo...@sparecreative.com> wrote:
>>> >> 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 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.
>>> >>
>>> >> Please, please help. As at the rate I¹m going I won¹t be needing a
>>> haircut
>>> >> for a while.
>>> >>
>>> >> Z.
>>> >>
>> >
>> >
>> >
> 
> 


Re: Freemarker Text Encoding Error

Posted by Musachy Barroso <mu...@gmail.com>.
It is good to post here, but for tricky stuff like this, you have a
better chance with them. Also if you find the solution, please let us
know.

musachy

On Tue, Aug 25, 2009 at 10:38 PM, Zoran
Avtarovski<zo...@sparecreative.com> wrote:
> I knew somebody would say that. I was too lazy to subscribe and I half
> expected them to ask on the struts list.
>
> Thanks Musachy, I’ll subscribe and post now. I guess I was hoping others
> might have experienced a similar problem.
>
> Z.
>
> did you try asking the FreeMarker guys?
>
> On Tue, Aug 25, 2009 at 7:26 PM, Zoran
> Avtarovski<zo...@sparecreative.com> wrote:
>> 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 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.
>>
>> Please, please help. As at the rate I¹m going I won¹t be needing a haircut
>> for a while.
>>
>> Z.
>>
>
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Freemarker Text Encoding Error

Posted by Zoran Avtarovski <zo...@sparecreative.com>.
I knew somebody would say that. I was too lazy to subscribe and I half
expected them to ask on the struts list.

Thanks Musachy, I’ll subscribe and post now. I guess I was hoping others
might have experienced a similar problem.

Z.
> 
> did you try asking the FreeMarker guys?
> 
> On Tue, Aug 25, 2009 at 7:26 PM, Zoran
> Avtarovski<zo...@sparecreative.com> wrote:
>> > 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 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.
>> >
>> > Please, please help. As at the rate I¹m going I won¹t be needing a haircut
>> > for a while.
>> >
>> > Z.
>> >
> 
> 


Re: Freemarker Text Encoding Error

Posted by Musachy Barroso <mu...@gmail.com>.
did you try asking the FreeMarker guys?

On Tue, Aug 25, 2009 at 7:26 PM, Zoran
Avtarovski<zo...@sparecreative.com> wrote:
> 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 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.
>
> Please, please help. As at the rate I¹m going I won¹t be needing a haircut
> for a while.
>
> Z.
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org