(You can also watch this "bug" here: 
https://issues.apache.org/struts/browse/WW-2455) 


We got the following form-element: 
<s:form action="HR_Personal_add" method="post" 
cssClass="Personal_bearbeiten" enctype="multipart/form-data" 
acceptcharset="utf-8"> 
... 
<s:textfield label="Vorname" name="p_vorname" required="true" /> 
<s:textfield label="Nachname" name="p_nachname" required="true" /> 
<s:file label="Foto" name="p_bild" /> 
.. 
</s:form> 

and the header-elements: 
<%@ page contentType="text/html;charset=UTF-8" language="java" %> 
<html> 
<head> 
... 
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> 
... 
</head> 


Trying the values: 
p_vorname = Özgün 
p_nachname = Ipslü 
p_bild = somefile.jpg 

if the form has been submitted, everything works fine in Firefox 2.x and 
the employyee will be put into the database through hibernate support. 
when now submitting the same form with the same values with internet 
explorer 6.028 an exception occurs: 

java.sql.SQLException: Incorrect string value: '\xEF\xBF\xBDzi' for column 
'vorname' at row 1 


i think this might be a problem with processing the utf-8 values / 
internet explorer compatibility. hibernate is set up properly and works 
fine with utf-8 support. 
the problem only occurs in the combination of utf-8 text values and the 
multipart/form-data statement. if multipart/form-data is left out 
everythink works fine, so i assume it's not hibernate 





i gave it another try and got deeper into the problem: 

Firefox works very fine, but IE only crashes and throws the exception when 
acceptcharset="utf-8" ist there in combination with multipart form-data.. 
if there is acceptcharset="utf-8" or multipart-/form-data standalone. 
everythink works as well in IE. but both form attributes together lead to 
the exception. 



i got on the idea to use 
System.out.println(request.getCharacterEncoding()); 
 System.out.println(getP_vorname()); 

here are the results 

Firefox: 
UTF-8 
Gülchan 

IE: 
UTF-8 
G?lchan 


seems that IE reconizes the utf-8 encryption but uses ISO one for the 
formular textfield. firefox does not have this problem. 
any suggestion? 

(this problem: https://issues.apache.org/struts/browse/STR-2100 seems to 
be very simmilar and occured in struts1. any suggestion how to fix it in 
struts2?) 

Reply via email to