Return-Path: Delivered-To: apmail-jakarta-velocity-user-archive@www.apache.org Received: (qmail 11768 invoked from network); 11 Jun 2004 03:19:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 11 Jun 2004 03:19:38 -0000 Received: (qmail 33676 invoked by uid 500); 11 Jun 2004 03:19:59 -0000 Delivered-To: apmail-jakarta-velocity-user-archive@jakarta.apache.org Received: (qmail 33336 invoked by uid 500); 11 Jun 2004 03:19:57 -0000 Mailing-List: contact velocity-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Velocity Users List" Reply-To: "Velocity Users List" Delivered-To: mailing list velocity-user@jakarta.apache.org Received: (qmail 33314 invoked by uid 99); 11 Jun 2004 03:19:57 -0000 Received: from [142.104.5.87] (HELO unix6.uvic.ca) (142.104.5.87) by apache.org (qpsmtpd/0.27.1) with ESMTP; Thu, 10 Jun 2004 20:19:57 -0700 Received: from unix6.uvic.ca (localhost [127.0.0.1]) by unix6.uvic.ca (8.12.10/8.12.10) with ESMTP id i5B3JNQ1035482 for ; Thu, 10 Jun 2004 20:19:23 -0700 Received: from localhost (chenjian@localhost) by unix6.uvic.ca (8.12.10/8.12.10/Submit) with ESMTP id i5B3JNjI035480 for ; Thu, 10 Jun 2004 20:19:23 -0700 X-Authentication-Warning: unix6.uvic.ca: chenjian owned process doing -bs Date: Thu, 10 Jun 2004 20:19:23 -0700 (PDT) From: chenjian@uvic.ca To: velocity-user@jakarta.apache.org Subject: #parse() and UTF-8 output problem Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-UVic-Virus-Scanned: OK - Passed virus scan by Sophos (sophie) on unix6 X-UVic-Spam-Scan: unix6.uvic.ca Not_scanned_LOCAL X-Scanned-By: MIMEDefang 2.33 (www . roaringpenguin . com / mimedefang) X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi, In my web application, I have a Controller servlet which extends Velocity Servlet. In the Controller servlet, I have // set the request/response encoding once and for all request.setCharacterEncoding("UTF-8"); response.setContentType("text/html; charset=UTF-8"); response.setCharacterEncoding("UTF-8"); This has been working great, the HTML rendered is in UTF-8. However, today I modified template so that the common parts get extracted. So, instead of html header stuff content html footer stuff I have #parse("include/header.vm") content #parse("include/footer.vm") But, when I run the web app, the browser displays two weird characters in the html page. When I looked at the html source, it is like < body> content .... So there is no newline between which was in the header.vm. When I take the response.setxxxx() encoding off and run the app again, the html page is good again. So, I guess the encoding messed up the #parse() somehow. But could not figure this out. Any help is greatly appreciated! Jian --------------------------------------------------------------------- To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: velocity-user-help@jakarta.apache.org