Return-Path: Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 24828 invoked from network); 17 Sep 2003 12:13:00 -0000 Received: from unknown (HELO mail3.cc.huji.ac.il) (132.64.1.21) by daedalus.apache.org with SMTP; 17 Sep 2003 12:13:00 -0000 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by mail3.cc.huji.ac.il (Postfix) with ESMTP id 338A06806E; Wed, 17 Sep 2003 15:09:52 +0300 (IDT) Received: from mail3.cc.huji.ac.il (localhost.localdomain [127.0.0.1]) by localhost.localdomain (VaMailArmor-2.0.1.14) id 24623-43F62CFC; Wed, 17 Sep 2003 15:09:51 +0300 Received: by mail3.cc.huji.ac.il (Postfix, from userid 31998) id C9C59680AD; Wed, 17 Sep 2003 15:09:51 +0300 (IDT) Received: from pob.huji.ac.il (pob.huji.ac.il [132.64.1.8]) by mail3.cc.huji.ac.il (Postfix) with ESMTP id EE5956807E for ; Wed, 17 Sep 2003 15:09:50 +0300 (IDT) Received: from ard.huji.ac.il (vetneuron.agri.huji.ac.il [128.139.15.95]) by pob.huji.ac.il (Postfix) with ESMTP id 730BBFB58 for ; Wed, 17 Sep 2003 15:12:58 +0300 (IDT) Message-ID: <3F684FCA.4050202@ard.huji.ac.il> Date: Wed, 17 Sep 2003 15:12:58 +0300 From: Yair Zohar User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 X-Accept-Language: en-us, en, he MIME-Version: 1.0 To: Tomcat Users List Subject: Re: A Hebrew Problem References: <2BB3E9E4D24AD511BA700800062B3544086D94A4@beex51.siemenscomms.co.uk> In-Reply-To: <2BB3E9E4D24AD511BA700800062B3544086D94A4@beex51.siemenscomms.co.uk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=-106.0 required=5.8 tests=AWL,BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES,USER_AGENT_MOZILLA_UA, USER_IN_WHITELIST autolearn=ham version=2.55 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) X-AntiVirus: checked by Vexira MailArmor (version: 2.0.1.14; VAE: 6.21.0.1; VDF: 6.21.0.44; host: mail3.cc.huji.ac.il) X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I have got to a solution: It might be a private case but it may help others. I'm reading the html with A BufferedReader that is running over a AsciiFileReader which is using FileInputStream. The idea is to read the file byte by byte casting it to char in a char array not before moving from ascii to unicode. while (not end of html) int readInt = input.read(); //moving from ascii to unicode // be aware ascii hebrew can occur in different sets (224 - / 128 - ) if (readInt>=224 & readInt<=250) readInt = readInt -224 +1488 //casting charArray[i] = (char)readInt; } it seems charset=windows-1255 displays hebrew for codes from 1488 I understood it after running this loop in a jsp page: <% for (int i=0; i<65535; i++) { %> <%=i %>   <%=(char)i %> <%}%> Thanks to all who directed me to the solution. Bodycombe, Andrew wrote: > I suggest setting the file.encoding system property. > > export CATALINA_OPTS="-Dfile.encoding=utf-8" > Then restart tomcat. > > I once had a similar problem with German umlaute characters and this seemed > to fix it. > > Andy > > -----Original Message----- > From: Yair Zohar [mailto:yair@ard.huji.ac.il] > Sent: 17 September 2003 10:33 > To: Tomcat Users List > Subject: Re: A Hebrew Problem > > > After some investigation I'll try to refrase and improve my problem > description: > > My Goal: including a hebrew html inside a jsp page. > > The Problem: hebrew is viewed by browser as question marks (no matter > charset). > > Some details from my investigation: > > When I request the hebrew html directly (not included in a jsp but as > the request target itself) I see it right (charset=windows-1255). > > When writing hebrew (same charset) in the same jsp page (that has the > include action) I see it right (but the included html is still ????). > > To be sure it's not the 'include' action ( page="relativePath/fileName" flush="true" />) fault, I replaced it by a > function that returns the included page as a string and ensures it's > read in ascii: > > <%= pageExecuter.readHtml() %> > > when this didn't help, I wanted to be sure my function is returning the > jsp page an ascii string, I wrote this in the jsp page: > > //moving the html string to a char array. > <%char [] c = pageExecuter.readHtml().toCharArray(); > > for (int i=0; i > > //displaying 'character code' 'character' > <%= (int)c[i] %>;  <%= c[i] %>
> > <% } %> > > in that way I can see in the browser each character's code and the > character itself. > I've got ascii codes, but near the hebrew ascii codes there were '?' > > (I'm aware of the different hebrew ascii sets exists I tried both > 224-250 , 128 - 154 ) > > My conclusion: > Tomcat doesn't send the browser a response with ascii code but with some > other code. > > Any Idea ? > > Thanks for your efforts. > > > > Anton Tagunov wrote: > >>Hello Yair! >> >>YZ> I have this hebrew problem: >>YZ> I'm trying to include a html in a jsp page: >>YZ> >>YZ> When it comes to a hebrew html the browser displays question marks >>YZ> instead of hebrew (no matter what charset do I choose in the browser). >> >>YZ> The same html is viewed nicely when I get it directly as a file >> >> >>1) >> >>Do I get you right that you have >> >> web-app-root/some/a.jsp >> web-app-root/other/b.html >> >>and when you do >> >> http://www.myserver.some-domain/my-web-app/other/b.html >> >>you get something real, not question marks? >> >>2) >> >>I vagually recall some talks about this being a JSP spec limitation >>on the list, but I did not delve into the topic then. >> >>I also recall that the it was mentioned then that the new >>spec-compliant but unconvinient behavior has been introduced >>recently. >> >>Anyone, any tips? >> >>(nagoya.apache.org eyebrowse search is not too much responsive when >>searching tomcat-dev, and tomcat-user is not indexed at all :-( >> >>YZ> System: RH9 with tomcat-4.1.18, mod_jk-2.0.43, apache-2.0.44, > > j2sdk1.4.2 > >>YZ> It all works fine on an old server: RH7.1 tomcat-4.0.4 apache-1.3 >>YZ> mysql-connector-java-3.0.7 j2sdk1.4.0_03 >> >>Anton >> >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org >> >> >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org > > --------------------------------------------------------------------- > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org > > >