Re:Re: tomcat 5.5.12 character encoding in server side is allways iso8895-1

2006-03-01 Thread idan amshalom
I changed it to utf-8 and also changed add useBodyEncoding=true
 

-
Yahoo! Mail
Bring photos to life! New PhotoMail  makes sharing a breeze. 

tomcat 5.5.12 character encoding in server side is allways iso8895-1

2006-02-27 Thread idan amshalom
hi.I have a problem of encoding in server side (in thebean) .I want to pass values to the bean in utf-8 and not in iso-8895-1 , I read about this problem and tried everything that was suggested.I work with tomcat 5.5.12 on windows Server 2003 . with java 1.5.0.2 at my top of the jsp I have :%@ page pageEncoding="utf-8" contentType="text/html;charset=utf-8"%also I have these lines:request.setCharacterEncoding("utf-8");response.setContentType("text/html;charset=UTF-8");I want to set a property in my bean and then to get this value and display it but I have encoding problem probably in the point of passing the value to the bean.it works when I used this line in the set function in the bean :new String(iInputStr.getBytes("ISO-8859-1"),"UTF-8");  this way,I get my String back in the jsp in the right encoding(UTF-8),but I don't understand why I need this
  line if
 Iused the other lines in the jsp.I manage to display hard coded Hebrew characterswith utf-8 in my page and also to get the value of a request parameter in utf-8 .  I attached the jsp and the bean source  thanks,  Idan
		 Yahoo! Mail 
Use Photomail to share photos without annoying attachments.%@ page pageEncoding=utf-8 contentType=text/html;charset=utf-8%

%
System.out.println(before setting encoding for response 
response.getCharacterEncoding():+response.getCharacterEncoding()+ 
request.getCharacterEncoding():+request.getCharacterEncoding());
request.setCharacterEncoding(utf-8);
 response.setContentType(text/html;charset=UTF-8);
// response.setContentType(text/html; charset=utf-8; pageEncoding=utf-8);
//System.out.println(b4 setting encoding for response);
//response.setCharacterEncoding(utf-8);
System.out.println(after setting encoding for response 
response.getCharacterEncoding():+response.getCharacterEncoding()+ 
request.getCharacterEncoding():+request.getCharacterEncoding());

%
jsp:useBean id=testEncoding class=com.modelity.utilities.EncodingTester 
scope=session/
jsp:setProperty name=testEncoding property=inputStr/
html
headmeta HTTP-EQUIV=Content-Type CONTENT=text/html; charset=utf-8

%
String iStr = testEncoding.getInputStr();
%

script
/script
/head
body
form name=mainForm action=%=response.encodeURL(test-idan1.jsp)%  
method=post
input type=text value= name=inputStr/
input type=submit value=Submit /

/form

brעברית שפה קשה - רוסית יותר קשה br
value:%=iStr%

/body
/html

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]