You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Alexey Romanchuk <ui...@gorodok.net> on 2005/03/06 11:37:02 UTC
valid field localized displayName prolem
Hello!
I have little problem with localization of my tapestry web-app.
When i try to set validfield label with
<static-binding name="displayName" value="****"/>
and value is string with locale letters (russian with me) i have
unicode sequence in rendered page like долж
there is nothing wrong but now it is impossible to test web-app.
i set xml header with my locale:
<?xml version="1.0" encoding="Windows-1251"?> but situation is
not changes.
any other ideas how put string w/out this hard utf encoding?
Alexey Romanchuk
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Re[2]: valid field localized displayName prolem
Posted by Kent Tong <ke...@cpttm.org.mo>.
Alexey Romanchuk <uinz <at> gorodok.net> writes:
> may be i can override it? where place of MarkupWriter factory? in
> Engine?
Just override the getMarkupWriter() method in your page. But
then you need to copy the original MarkupWriter class to
create your own. However, please do *NOT* do this as it is
unrelated to your problem!
> jwebunit dont recognize it. and there is 5 characters instead one. i
> think it is no good..;)
I just tried using jwebunit to test a page with Chinese:
<select name="locale">
<option value="0">English</option>
<option value="1">中文 (台灣)</option>
</select>
The Chinese is escaped, but it works just fine because the
HTML parser should turn them back into unicode characters.
So, your problem must reside somewhere else.
FYI, here is my test case:
public class JWebUnitTestCase extends WebTestCase {
public JWebUnitTestCase(String name) {
super(name);
}
protected void setUp() throws Exception {
getTestContext().setBaseUrl(
"http://localhost:8080/OnlineForum");
}
public void testUnicode() {
beginAt("/app");
assertOptionsEqual("locale", new String[] {"English", "中文 (台灣)"});
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re[2]: valid field localized displayName prolem
Posted by Alexey Romanchuk <ui...@gorodok.net>.
Hello!
KT> This is a feature of the MarkupWriter in Tapestry (as of 3.0). It
KT> treats characters other than the "normal" ones (a-z, 0-9 and etc)
KT> as unsafe and escape them as unicode. This has nothing to do with
KT> your template encoding.
may be i can override it? where place of MarkupWriter factory? in
Engine?
KT> But why it makes it impossible to test your app? When you check
KT> the text in Java, it is just characters.
jwebunit dont recognize it. and there is 5 characters instead one. i
think it is no good..;)
same situation with FieldLabel and Delegator.
Alexey Romanchuk
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: valid field localized displayName prolem
Posted by Kent Tong <ke...@cpttm.org.mo>.
Alexey Romanchuk <uinz <at> gorodok.net> writes:
>
> Hello!
> I have little problem with localization of my tapestry web-app.
> When i try to set validfield label with
> <static-binding name="displayName" value="****"/>
> and value is string with locale letters (russian with me) i have
> unicode sequence in rendered page like долж
> there is nothing wrong but now it is impossible to test web-app.
> i set xml header with my locale:
> <?xml version="1.0" encoding="Windows-1251"?> but situation is
> not changes.
This is a feature of the MarkupWriter in Tapestry (as of 3.0). It
treats characters other than the "normal" ones (a-z, 0-9 and etc)
as unsafe and escape them as unicode. This has nothing to do with
your template encoding.
But why it makes it impossible to test your app? When you check
the text in Java, it is just characters.
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org