1 Reply Latest reply: Sep 15, 2007 9:57 AM by DarrylBurke RSS

    UTF-8 String issues

    807600
      Hi ,
      i have a csv file that i'm uploading trough tomcat 5.5 to my servlet , when i'm looking at it in debug the hebrew letters appear in some weird english format when i try to convert it to other formats with
      byte[] stringBytesISO = isoString.getBytes(beforeEncoding);
               utf8String = new String(stringBytesISO, "UTF-8");
      nothing helps no matter what format i try , i know i'm getting it in UTF8 because when i assign beforeEncoding to UTF-8 it doesn't change i've tried windows-1255 and many others and none could retreive it back to hebrew , when i look at the csv file in firefox's properties it says it's windows 1255 .
      the jsp is configured to utf 8 with i've tried ISO-8859-1 allso
      <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
      how can i find out what encoding is it saved at and get the hebrew letters back ?
      thanks guys .

      Edited by: Kernel_77 on Sep 15, 2007 6:48 AM
        • 1. Re: UTF-8 String issues
          DarrylBurke
          {color:#000080}Kernel_77

          This is just a guess, something for you to do while waiting for a response from a truly knowledgeable member :-) try this code:{color}
          // Method String.getBytes(String charsetName)
          byte[] stringBytesISO = isoString.getBytes("UTF-8");
          // Constructor String(byte[] bytes)
          String utf8String = new String(stringBytesISO);
          {color:#000080}db{color}