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/09/22 18:36:08 UTC

UTF8

hi ,
i'm using tomcat 5.5 and jdk5 allso using commons.fileupload , when 
uploading a XML that contains hebrew fonts i can't seem to get it in utf8 in 
the servlet tough JSP is configured to utf8 with :
<%@ page language="java" contentType="text/html; charset=UTF-8" 
pageEncoding="UTF-8" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="content-type" content="text/html; charset=UTF-8">



i suspect that i might be getting in utf 8 but maybe it differs from java's 
UTF8 (that's impossible isn't it ?) because when i try to convert using new 
String(stringByte,"UTF-8") it returns the same while with other encodings in 
can see in debug content changes ... i'm realy at a jam here people i have a 
deadline adn i can't seem to fix this silly bug any ideas ?

when i open the xml with firefox and check properties it says windows-1255 
but when i try using the getbytes method to init stringByte it doesn't 
matter , i had this problem once with tomcat but it was with a simple 
textarea input and then i just converted to utf8 like i described above from 
iso-8859-1 but now i can't seem to do that ..




---------------------------------------------------------------------
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


Re: UTF8

Posted by Amnon Lahav <am...@gmail.com>.
i just noticed the reply , i don't understand what u mean would you mind
explaining ?

On 9/23/07, Lucas Galfaso <lg...@gmail.com> wrote:
>
> hi,
>   What happens if you escape every char in the XML file? This is you
> replace character number nnn to "&#nnn;" (quotes for clarity.) The
> number has to be the ISO-10646 of the character and, lucky for you,
> this is the case of Javas internal encoding.
>
> Regards,
>   lg
>
> On 9/22/07, Amnon Lahav <am...@gmail.com> wrote:
> > hi ,
> > i'm using tomcat 5.5 and jdk5 allso using commons.fileupload , when
> > uploading a XML that contains hebrew fonts i can't seem to get it in
> utf8 in
> > the servlet tough JSP is configured to utf8 with :
> > <%@ page language="java" contentType="text/html; charset=UTF-8"
> > pageEncoding="UTF-8" %>
> >
> > <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> > "http://www.w3.org/TR/html4/loose.dtd">
> >
> > <meta http-equiv="content-type" content="text/html; charset=UTF-8">
> >
> >
> >
> > i suspect that i might be getting in utf 8 but maybe it differs from
> java's
> > UTF8 (that's impossible isn't it ?) because when i try to convert using
> new
> > String(stringByte,"UTF-8") it returns the same while with other
> encodings in
> > can see in debug content changes ... i'm realy at a jam here people i
> have a
> > deadline adn i can't seem to fix this silly bug any ideas ?
> >
> > when i open the xml with firefox and check properties it says
> windows-1255
> > but when i try using the getbytes method to init stringByte it doesn't
> > matter , i had this problem once with tomcat but it was with a simple
> > textarea input and then i just converted to utf8 like i described above
> from
> > iso-8859-1 but now i can't seem to do that ..
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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
> >
> >
>
> ---------------------------------------------------------------------
> 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
>
>

Re: UTF8

Posted by Lucas Galfaso <lg...@gmail.com>.
hi,
  What happens if you escape every char in the XML file? This is you
replace character number nnn to "&#nnn;" (quotes for clarity.) The
number has to be the ISO-10646 of the character and, lucky for you,
this is the case of Javas internal encoding.

Regards,
  lg

On 9/22/07, Amnon Lahav <am...@gmail.com> wrote:
> hi ,
> i'm using tomcat 5.5 and jdk5 allso using commons.fileupload , when
> uploading a XML that contains hebrew fonts i can't seem to get it in utf8 in
> the servlet tough JSP is configured to utf8 with :
> <%@ page language="java" contentType="text/html; charset=UTF-8"
> pageEncoding="UTF-8" %>
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
>
> <meta http-equiv="content-type" content="text/html; charset=UTF-8">
>
>
>
> i suspect that i might be getting in utf 8 but maybe it differs from java's
> UTF8 (that's impossible isn't it ?) because when i try to convert using new
> String(stringByte,"UTF-8") it returns the same while with other encodings in
> can see in debug content changes ... i'm realy at a jam here people i have a
> deadline adn i can't seem to fix this silly bug any ideas ?
>
> when i open the xml with firefox and check properties it says windows-1255
> but when i try using the getbytes method to init stringByte it doesn't
> matter , i had this problem once with tomcat but it was with a simple
> textarea input and then i just converted to utf8 like i described above from
> iso-8859-1 but now i can't seem to do that ..
>
>
>
>
> ---------------------------------------------------------------------
> 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
>
>

---------------------------------------------------------------------
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