tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yair Zohar <y...@ard.huji.ac.il>
Subject Re: Problems with utf-8 encoding
Date Mon, 19 Sep 2005 08:08:27 GMT
Guy Katz wrote:

>put an encoding filter in front of your servlet/jsp's that sets a UTF-8 encoding for incoming
requests and outgoing responses. its your safest bet for tomcat 4 as far as i remember.
>
>-----Original Message-----
>From: Yair Zohar [mailto:yair@ard.huji.ac.il]
>Sent: Monday, September 19, 2005 9:43 AM
>To: Tomcat Users List
>Subject: Re: Problems with utf-8 encoding
>
>
>Anto Paul wrote:
>
>  
>
>>On 9/19/05, Yair Zohar <yair@ard.huji.ac.il> wrote:
>> 
>>
>>    
>>
>>>Hello,
>>>I'm using Tomcat 4.1.18
>>>I'm trying to read hebrew data in utf-8 encoding from the database. As a
>>>check I entered a utf-8 encoded 'alef' letter to the database field.
>>>(I see it in the database as one letter 'alef'). The jsp page that
>>>displays the data, prints two chars instead of one. I checked the values
>>>of these chars and
>>>they are 215 114, which are the utf-8 combination to create the letter
>>>'alef'  (so I was told).
>>>
>>>jps code:
>>>
>>><%@ page language="java" contentType="text/html;charset=UTF-8"
>>>pageEncoding="UTF-8" info="Tables Handler" import="tablesHandler.*" %>
>>>
>>><jsp:useBean id="tables" scope="page" class="tablesHandler.TableViewer" />
>>><jsp:setProperty name="tables" property="*"/>
>>>
>>><% request.setCharacterEncoding("UTF-8");%>
>>>
>>><html>
>>>
>>><head>
>>>   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
>>></head>
>>>
>>>   
>>>
>>>      
>>>
>>Move <% request.setCharacterEncoding("UTF-8");%> to before jsp:useBean tag.
>>
>> 
>>
>>    
>>
>Thanks for replying,
>It didn't fix the problem, I still see the same two chars.
>Yair.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>  
>
Guy, can you direct me to practical documentation on implementing such a 
filter ?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message