I added a Filter, and it did succeed.
public void doFilter(ServletRequest arg0, ServletResponse arg1,
FilterChain arg2) throws IOException, ServletException {
// TODO Auto-generated method stub
arg1.setCharacterEncoding("UTF-8");
arg1.setContentType("text/html; charset=UTF-8");
arg2.doFilter(arg0, arg1);
}
http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
hilo Start Page
oo
TT
zzz
中文測 試
Choose a number from 1 to 10:
${index}
On 4/13/07, xu yiwei <[EMAIL PROTECTED]> wrote:
The question is the UTF-8 couldn't work!
putting a UTF-8 char in the Start.html will result in a exception.
the "Start.html" is ISO-8859-1 charset default, can I change that? and
How?
2007/4/13, Kevin Lau <[EMAIL PROTECTED]>:
> Well, your question now is not about whether the T5 support Chinese,
it's
> about how to use i18n. You don't even know why you put the "charset=GBK"
> into the template or what's the difference between UTF-8 and GBK.
>
> My suggestion is, forget about the Chinese first, use UTF8 to get the
i18n
> work, then think about the Chinese thing.
>
> On 4/13/07, xu yiwei <[EMAIL PROTECTED]> wrote:
> >
> >
> > doesn't work right,
> > Exception message:
> > Failure parsing template context:WEB-INF/Start.html: The element type
> > "meta" must be terminated by the matching end-tag "".
> >
> > so I put "" after the " > content="text/html; charset=GBK"> "
> >
> > Start.html include "The current time is: ${currentTime}.时间 "
> > 时间 means time!
> > Exception message:
> > Failure parsing template context:WEB-INF/Start.html: Invalid byte 1 of
> > 1-byte UTF-8 sequence.
> > The current time is: ${currentTime}.??
> >
> >
> >
> >
> >
> > 2007/4/13, Kevin Lau <[EMAIL PROTECTED]>:
> > > is for xml file, not for the
html
> > > file.
> > > For the html file, you need to specify the charset by such staff
> > >
> > >
> > > You really need to learn about the basic before purposeless test...
> > >
> > > On 4/13/07, xu yiwei <[EMAIL PROTECTED]> wrote:
> > > >
> > > > I wtite "" at the first
line of
> > > > Start.html.
> > > > "现在时间是: ${currentTime}." same as "The current time is:
> > > > ${currentTime}. "
> > > > Something's wrong!
> > > > The exception message:
> > > > Failure parsing template context:WEB-INF/Start.html: Invalid byte
2 of
> > > > 2-byte UTF-8 sequence.
> > > > "?: ${currentTime}."
> > > >
> > > > It couldn't read " a file with the correct charset "
> > > >
> > > >
> > > >
> > > > 2007/4/13, Howard Lewis Ship <[EMAIL PROTECTED]>:
> > > > > T5 does not yet have the logic in place in T4 to allow the
character
> > > > > set to be configured before reading a .properties file or HTML
> > > > > template. For the template, you should be able to set the
charset
> > > > > inside the tag.
> > > > >
> > > > > The other aspect is output; T5 is hard coded to send, if I
remember
> > > > > correctly, UTF-8, which will be hard pressed to output Chinese
> > > > > properly. So there's problems at both ends: reading a file with
the
> > > > > correct charset, resulting in correct Unicode in memory, then
> > > > > outputting that unicode into the correct charset for the
browser.
> > > > >
> > > > > On 4/12/07, xu yiwei <[EMAIL PROTECTED]> wrote:
> > > > > > *_zh.html could not display chinese!
> > > > > > Doesn't work!
> > > > > >
> > > > > > 2007/4/12, Kevin Lau <[EMAIL PROTECTED]>:
> > > > > > > Use the localization.
> > > > > > >
> > > >
> >
http://tapestry.apache.org/tapestry5/tapestry-core/guide/localization.html
> > > > > > >
> > > > > > > On 4/12/07, xu yiwei <[EMAIL PROTECTED]> wrote:
> > > > > > > >
> > > > > > > > I am now trying to use T5 to develop a simple system.
> > > > > > > > but it couldn't display the chinese.
> > > > > > > > This method did not work
> > > > > > > > configuration.add("tapestry.supported-locales", "zh");
> > > > > > > > i couldn't write non-ascll chars in the page(Start.html
);
> > > > > > > >
> > > > > > > > will
> > > > > > > >
> > > > > > > >
> > > >
-
> > > > > > > > To unsubscribe, e-mail:
[EMAIL PROTECTED]
> > > > > > > > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > >
> > > >
.
> > > > > > > Man in the mirror
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Chinese name:徐 依伟
> > > > > > English name: will
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Howard M. Lewis Ship
> > > > > TWD Consulting, Inc.
> > > > > Independent J2EE / Open-Source Java Consultant
> > > > > Creator and PMC Chair, Apache Tapestry
> > > > > Creator, Apache HiveMind
> > > > >
> > > > > Professional Tapestry training, mentoring, support
> > > > > and project work. http://howardlewisship.com
> > > > >
> > > >
> >