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 2011/10/19 05:48:46 UTC

s:text encoding issue

I'm having an issue using the s:text tag, in that it is displaying garbage
on the screen. But if I use a s:property tag all works well.

For example if I use the two following tags and select Arabic:
<s:property value="getText('language.selection.instructions')"/>
<s:text name="language.selection.instructions" searchValueStack="false"/>

The first works as expected and the displayed text is perfect, but the
second just produces a series of question marks.

I'd appreciate any help as we've just spent a shit load of time
standardising on s:text and I don't really want to have to do it all over
again.

We are using struts 2.2.2, everything is UTF-8, struts, jsp, sitemesh,
freemarker and jdbc connection.

Z. 



Re: s:text encoding issue

Posted by Zoran Avtarovski <zo...@sparecreative.com>.
Hi Lucasz,

Here's the entry from struts.xml

    <constant name="struts.i18n.encoding" value="UTF-8"/>

Z.



On 19/10/11 4:23 PM, "Łukasz Lenart" <lu...@googlemail.com> wrote:

>2011/10/19 Zoran Avtarovski <zo...@sparecreative.com>:
>> We are using struts 2.2.2, everything is UTF-8, struts, jsp, sitemesh,
>> freemarker and jdbc connection.
>
>and struts.i18n.encoding= ?
>
>
>Regards
>-- 
>Łukasz
>+ 48 606 323 122 http://www.lenart.org.pl/
>Warszawa JUG conference - Confitura http://confitura.pl/
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>



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


Re: s:text encoding issue

Posted by Łukasz Lenart <lu...@googlemail.com>.
2011/10/19 Zoran Avtarovski <zo...@sparecreative.com>:
> We are using struts 2.2.2, everything is UTF-8, struts, jsp, sitemesh,
> freemarker and jdbc connection.

and struts.i18n.encoding= ?


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/

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


Re: s:text encoding issue

Posted by Łukasz Lenart <lu...@googlemail.com>.
There is a small difference how the both calls flow throughout
internal I18N support. Could you send to me the phrase you have
problem with ? In Arabic ;-)


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/

W dniu 20 października 2011 01:05 użytkownik Zoran Avtarovski
<zo...@sparecreative.com> napisał:
> No. My Mac uses en_AU as the default, but like you we use the
> request_locale parameter with the required locale. The system is designed
> to enable users to select the desired locale.
>
> The strange part is that that we haven't had any issues in the past when
> we just had Scandinavian languages, the problem only appears with Arabic
> and some African languages.
>
> I might have to look at the source for s:text tag and see if there is
> something I am missing.
>
> The key issue here is the getText method call on ActionSupport is working
> as expected, which is why I'm confused.
>
> Z.
>
>
> On 20/10/11 12:09 AM, "Łukasz Lenart" <lu...@googlemail.com> wrote:
>
>>I did the same with struts2-blank example application and it works
>>just fine. My Mac uses EN locale by default but you can change locale
>>in the app with request_locale parameter and it works as expected.
>>
>>What you mean by "the selected locale is Arabic" ? Is it the system
>>locale ?
>>
>>
>>Kind regards
>>--
>>Łukasz
>>+ 48 606 323 122 http://www.lenart.org.pl/
>>Warszawa JUG conference - Confitura http://confitura.pl/
>>
>>2011/10/19 Zoran Avtarovski <zo...@sparecreative.com>:
>>> It woks fine for the default locale for me as well.
>>>
>>> Where it fails is when the selected locale is Arabic. Using the getText
>>> method in application support works as expected but s:text fails to
>>>render
>>> the text correctly.
>>>
>>> Z.
>>>
>>> On 19/10/11 11:20 PM, "Li Ying" <li...@gmail.com> wrote:
>>>
>>>>I tried the JSP code which you posted. It works fine.
>>>>
>>>>What is your [locale]?  you said, you [select Arabic], do you mean
>>>>[locale] is [Arabic]?
>>>>
>>>>What name is your property file, and what is the content in it?
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
>>
>
>
>

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


Re: s:text encoding issue

Posted by Zoran Avtarovski <zo...@sparecreative.com>.
No. My Mac uses en_AU as the default, but like you we use the
request_locale parameter with the required locale. The system is designed
to enable users to select the desired locale.

The strange part is that that we haven't had any issues in the past when
we just had Scandinavian languages, the problem only appears with Arabic
and some African languages.

I might have to look at the source for s:text tag and see if there is
something I am missing.

The key issue here is the getText method call on ActionSupport is working
as expected, which is why I'm confused.

Z.


On 20/10/11 12:09 AM, "Łukasz Lenart" <lu...@googlemail.com> wrote:

>I did the same with struts2-blank example application and it works
>just fine. My Mac uses EN locale by default but you can change locale
>in the app with request_locale parameter and it works as expected.
>
>What you mean by "the selected locale is Arabic" ? Is it the system
>locale ?
>
>
>Kind regards
>-- 
>Łukasz
>+ 48 606 323 122 http://www.lenart.org.pl/
>Warszawa JUG conference - Confitura http://confitura.pl/
>
>2011/10/19 Zoran Avtarovski <zo...@sparecreative.com>:
>> It woks fine for the default locale for me as well.
>>
>> Where it fails is when the selected locale is Arabic. Using the getText
>> method in application support works as expected but s:text fails to
>>render
>> the text correctly.
>>
>> Z.
>>
>> On 19/10/11 11:20 PM, "Li Ying" <li...@gmail.com> wrote:
>>
>>>I tried the JSP code which you posted. It works fine.
>>>
>>>What is your [locale]?  you said, you [select Arabic], do you mean
>>>[locale] is [Arabic]?
>>>
>>>What name is your property file, and what is the content in it?
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>For additional commands, e-mail: user-help@struts.apache.org
>>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>



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


Re: s:text encoding issue

Posted by Łukasz Lenart <lu...@googlemail.com>.
I did the same with struts2-blank example application and it works
just fine. My Mac uses EN locale by default but you can change locale
in the app with request_locale parameter and it works as expected.

What you mean by "the selected locale is Arabic" ? Is it the system locale ?


Kind regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/

2011/10/19 Zoran Avtarovski <zo...@sparecreative.com>:
> It woks fine for the default locale for me as well.
>
> Where it fails is when the selected locale is Arabic. Using the getText
> method in application support works as expected but s:text fails to render
> the text correctly.
>
> Z.
>
> On 19/10/11 11:20 PM, "Li Ying" <li...@gmail.com> wrote:
>
>>I tried the JSP code which you posted. It works fine.
>>
>>What is your [locale]?  you said, you [select Arabic], do you mean
>>[locale] is [Arabic]?
>>
>>What name is your property file, and what is the content in it?
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


Re: s:text encoding issue

Posted by Zoran Avtarovski <zo...@sparecreative.com>.
It woks fine for the default locale for me as well.

Where it fails is when the selected locale is Arabic. Using the getText
method in application support works as expected but s:text fails to render
the text correctly.

Z.

On 19/10/11 11:20 PM, "Li Ying" <li...@gmail.com> wrote:

>I tried the JSP code which you posted. It works fine.
>
>What is your [locale]?  you said, you [select Arabic], do you mean
>[locale] is [Arabic]?
>
>What name is your property file, and what is the content in it?
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>



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


Re: s:text encoding issue

Posted by Li Ying <li...@gmail.com>.
I tried the JSP code which you posted. It works fine.

What is your [locale]?  you said, you [select Arabic], do you mean
[locale] is [Arabic]?

What name is your property file, and what is the content in it?

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


Re: s:text encoding issue

Posted by 铁屋子读书 <ti...@gmail.com>.
I tried the JSP code which you posted. It works fine.

What is your [local]? What name is your property file, and what content in it?

And one more thing, you said, you [select Arabic], what does that mean?

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