try setting a full "default.contentType" property in your
velocity.properties.  something like

default.contentType = text/html; charset=UTF-8

also, is there anything setting the content type on the
HttpServletResponse before/during/after the VelocityViewServlet gets
it?

On 11/7/05, Pham Anh Tuan <[EMAIL PROTECTED]> wrote:
> Set encoding in velocity properties file:
> #----------------------------------------------------------------------------
> # T E M P L A T E  E N C O D I N G
> #----------------------------------------------------------------------------
>
> input.encoding=UTF-8
> output.encoding=UTF-8
>
> -----------------------------------------------
> my .properties file (encoded UTF-8)
> hello=tưởng chừng
>
> -----------------------------------------------------
> my .vm file
> <html>
> <head>
> <meta http-equiv="content-type" content="text/html; charset=utf-8">
> </head>
> <body>
> $test.hello
> </body>
> </html>
> ------------------------------------------------------
> what happened, plz help me :(
>
> *************************************************
> Pham Anh Tuan
> Java Developer, HR Assistant
> ICHI Corporation Vietnam.
> Room #1001, 37 Ton Duc Thang, Dist. 1
> Ho Chi Minh City, Vietnam.
> Phone: (+84) (08) 9105732
> Fax: (+84) (08) 9105734
> Cell: (+84) (0) 989 505897
> Email: [EMAIL PROTECTED]
> Website: http://www.ichi-corp.jp
> *************************************************
> ----- Original Message -----
> From: "Pham Anh Tuan" <[EMAIL PROTECTED]>
> To: "Velocity Users List" <velocity-user@jakarta.apache.org>
> Sent: Tuesday, November 08, 2005 1:30 PM
> Subject: Re: [HELP] browser counldn't recognize charset=UTF-8 in meta tag :(
>
>
> > thanks to Malcolm, but ... :( ...
> >
> > When I do the way you instruct, my browser is automatically change
> > encoding to UTF-8, but, my properties's content is showed incorrectly. I
> > mean, before I change encoding in velocity property file, everytime I view
> > 1 .vm file and I want to view page's content correctly, I must change the
> > encode of that page by click on View\Encoding\UTF-8, after that, page's
> > content is viewed correctly. But after I do the way you show me, the
> > browser automatically change encode to UTF-8, but ... content is showed
> > correctly :( ...
> >
> > I don't know what wrong, my properties file (whose content is encoded in
> > UTF-8) :( ..
> >
> >
> > *************************************************
> > Pham Anh Tuan
> > Java Developer, HR Assistant
> > ICHI Corporation Vietnam.
> > Room #1001, 37 Ton Duc Thang, Dist. 1
> > Ho Chi Minh City, Vietnam.
> > Phone: (+84) (08) 9105732
> > Fax: (+84) (08) 9105734
> > Cell: (+84) (0) 989 505897
> > Email: [EMAIL PROTECTED]
> > Website: http://www.ichi-corp.jp
> > *************************************************
> > ----- Original Message -----
> > From: "Malcolm Edgar" <[EMAIL PROTECTED]>
> > To: "Velocity Users List" <velocity-user@jakarta.apache.org>
> > Sent: Tuesday, November 08, 2005 11:51 AM
> > Subject: Re: [HELP] browser counldn't recognize charset=UTF-8 in meta tag
> > :(
> >
> >
> > You need to set Velocity properties to configure the output content type.
> >
> > regards Malcolm
> >
> > On 11/8/05, Pham Anh Tuan <[EMAIL PROTECTED]> wrote:
> >>
> >> Hi all,
> >>
> >> I use Struts Framework + Tiles + Velocity, I had set in .vm file with a
> >> header like below:
> >>
> >> <html>
> >> <head>
> >> <meta http-equiv="content-type" content="text/html; charset=utf-8">
> >> <title>test</title>
> >> </head>
> >> ....
> >>
> >> but after the action of Struts, the page which is showed is not encoded
> >> in
> >> utf-8, so t content in that page are not viewed in utf-8 :(
> >>
> >> I don't know what happened, plz help me!
> >>
> >> Tuan
> >>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to