You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Amnon Lahav <am...@gmail.com> on 2007/10/04 20:24:16 UTC
Can't read hebrew from file uploaded by commons.fileupload
Hi i've asked for help a week ago and the anwers i get i didn't help me i
would realy appreciate some help here i'm reading a csv file that i upload
by commons.fileupload , when i just open the file on the HD and use a
function to read it everything is ok but when i try to upload it the
charEncoding gets all mixed up and i can't convert it back to hebrew no
matter what i try .
here is how i configed everything related
and i've tried allmost all charencoding i can think of with
public String convertEncoding(String isoString,String before,String after)
{
String utf8String = null;
if (null != isoString && !isoString.equals(""))
{
try
{
byte[] stringBytesISO = isoString.getBytes(before);
utf8String = new String(stringBytesISO,after);
}
catch(Exception e)
{
// As we can't translate just send back the best guess.
System.out.println("UnsupportedEncodingException is: " + e.getMessage());
utf8String = isoString;
}
}
else
{
utf8String = isoString;
}
return utf8String;
}
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
in the jsp i allso use request.setcharcterencoding("utf8")
when i open the csv with firefox on HD and properties->encoding it says
windows1255
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org