On 20/04/2015 15:49, Neill Lima wrote: > Try adding this to your html: > > <head> > *<meta charset="UTF-8">* > </head> > > On Mon, Apr 20, 2015 at 4:45 PM, radiatejava <[email protected]> wrote: > >> Hello Tomcat users, have code like this in my jsp: >> >> <td>"${pageKeys.ui_user_name_label}";</td> >> >> Where <td> represents a cell of an html table. >> >> Value of the variable pageKeys.ui_user_name_label populated in server >> side is in french and it is exactly as shown below: >> >> Nom d'utilisateur >> >> However, while displaying this in the browser, this is getting displayed >> as: >> >> Nom d’utilisateur >> >> >> How can I get this corrected ? When I try to see the source code, I >> see something like this: >> >> out.write((java.lang.String) >> >> org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${pageKeys.ui_user_name_label}", >> java.lang.String.class, >> (javax.servlet.jsp.PageContext)_jspx_page_context, null, false)); >> >> What I want to know from developers here is whether the above code >> really does some escaping/encoding of the content ?
Tomcat will use whatever encoding you have configured for the JSP page. If you don't define an encoding then the default will be used. Note that using '<meta charset="UTF-8">' is just meaningless template text as far as Tomcat is concerned and will have no impact on how Tomcat generates the page. >> Is a there a way to avoid this encoding ? You cannot avoid encoding. You have to define the mapping you wish to use to map from bytes to characters. If you do not, the default will be used. You should take a look at the Character Encoding part of the FAQ on the wiki: http://wiki.apache.org/tomcat/FAQ/CharacterEncoding Mark --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
