If you're using Tomcat, you could
try starting it with a -Dfile.encoding="UTF-8" parameter.
Tomcat will use UTF-8 internally and will not assume iso-8859-1
encoding for all files for which encoding cannot be acquired. Myfaces
should not convert non-ascii characters to html entities with this
configuration.
There's of course a matter of facelets reading the source file with the
correct encoding. I don't know flaceslets and I can't help here.
Regards,
PaSik
Randahl Fink Isaksen napisał(a):
Thank you for your suggestion but I would expect MyFaces to be able to
output UTF-8 on its own without me putting a filter in front of it.
Is there really no built-in approach for serving UTF-8???
Randahl
Cagatay Civici wrote:
A filter is a common way to do it.
If you're not using spring you can come up with your own filter. Very
simple indeed, Here's an example.
http://www.jroller.com/page/mert?entry=utf_8_encoding_with_jsf
Cagatay
On 10/30/06, Sean Wesenberg <
[EMAIL PROTECTED]> wrote:
AppFuse
uses a spring filter to force UTF-8 character encoding.
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter
-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
http://www.springframework.org/docs/api/org/springframework/web/filter/Chara
cterEncodingFilter.html
I'm not sure if this is will solve your problem, just something I ran
across
when checking out appfuse this weekend.
-----Original Message-----
From: Randahl Fink Isaksen [mailto: [EMAIL PROTECTED]]
Sent: Monday, October 30, 2006 9:15 AM
To: MyFaces Discussion; Facelets Users' List
Subject: How can I set the character encoding to UTF-8?
I am using MyFaces and Facelets and trying to deliver XHTML with UTF-8
encoding, but when outputting national characters they are converted to
&#xyz; codes.
I have found out that the MyFaces ResponseWriter thinks I want
ISO-8859-1 encoding because calling
FacesContext.getResponseWriter
().getCharacterEncoding() returns the
ISO-8859-1 value.
All my Facelet view files are written in UTF-8 and they all state that
they are UTF-8 as follows
<?xml version="1.0" encoding="UTF-8"?>
Can anyone give me a hint why MyFaces still thinks I am serving
ISO-8859-1 ?
I am using the default render kit (if that matters), my facelet views
are written as .xml files in which I do NOT have an f:view tag which
the
Facelet developer's claim is not necessary when using Facelets.
Randahl
---------------------------------------------------------------------
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
|
- Re: How can I set the character encoding to UTF-8? Tomasz Pasierb
-