velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mailmur <>
Subject Re: #parse() and UTF-8 response encoding problem
Date Sun, 13 Jun 2004 18:32:03 GMT
Please, look at this page if it helps you. Probably
you get UTF-8 BOM markers, which currently is
unsupported in Java. Win2k/XP Notepad stores UTF-8
files with leading bom mark bytes.

I've made own UnicodeFileResourceLoader to fully
support UTF-8BOM marked text files.

I encourage everyone to use UTF-8 fileformats even
that current OSses dont always use it as a default.
Probably WinLonghorn uses it as a default...or atleast
dotNet uses it if nothing else is specified. Your i18n
life is a lot easier with unicode format.

I store all my .properties, .vm and .jsp files as
UTF-8BOM format.

--- chenjian <> wrote:
> // set the request/response encoding once and for
> all 
> request.setCharacterEncoding("UTF-8"); 
> response.setContentType("xxxxxxx; charset=UTF-8"); 
> response.setCharacterEncoding("UTF-8");
> #parse("include/header.vm") 
> body content
> #parse("include/footer.vm")
> But, when I run the web app, the browser displays
> two weird characters in the 
> web page. When I looked at the page source, the

Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger. 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message