You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2001/03/09 23:34:37 UTC

[Bug 202] New - If browser send russian locale (ru) then StaticInterceptor traps with a "non ISO-8859-1" charset exception at attempt to write buf to ServletOutputStream, the date gets cyricllic characters BugRat Report#311

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=202

*** shadow/202	Fri Mar  9 14:34:37 2001
--- shadow/202.tmp.7617	Fri Mar  9 14:34:37 2001
***************
*** 0 ****
--- 1,69 ----
+ +============================================================================+
+ | If browser send russian locale (ru) then StaticInterceptor traps with a "n |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 202                         Product: Tomcat 3                |
+ |       Status: UNCONFIRMED                 Version: 3.2.1 Final             |
+ |   Resolution:                            Platform: All                     |
+ |     Severity: Normal                   OS/Version: All                     |
+ |     Priority: High                      Component: Encoding                |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: cmanolache@yahoo.com                                         |
+ |  Reported By: tomcat-dev@jakarta.apache.org                                |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ in src/share/org/apache/tomcat/request/StaticInterceptor.java, line apporx 354, we've got
+ 
+     public void doService(Request req, Response res)
+         throws Exception
+     {
+         // this is how ge...
+         // the next round of optimizations
+         Locale locale=RequestUtil.getLocale(req);
+         StringManager sm=StringManager.getManager("org.apache.tomcat.resources",locale);
+         DateFormat dateFormat =
+             new SimpleDateFormat(datePattern,locale );
+             ...
+ and later, at line around 488 (at the end of doService()) we've got
+                 ...
+                 buf.append("<td align=right><tt>");
+                 buf.append(dateFormat.format(new Date(f.lastModified())));
+                 ...
+ which resulted in the following exception 
+ 
+ java.io.IOException: Not an ISO 8859_1 character:?
+ 	at java.lang.Throwable.(Throwable.java:96)
+ 	at java.lang.Exception.(Exception.java:44)
+ 	at java.io.IOException.(IOException.java:49)
+ 	at org.apache.tomcat.core.BufferedServletOutputStream.print(BufferedServletOutputStream.java(Compiled Code))
+ 	at org.apache.tomcat.request.DirHandler.doService(StaticInterceptor.java:538)
+ 	at org.apache.tomcat.core.Handler.service(Handler.java:263)
+ 	at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:371)
+ 	at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:786)
+ 	at org.apache.tomcat.core.ContextManager.service(ContextManager.java:732)
+ 	at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
+ 	at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:407)
+ 	at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
+ 	at java.lang.Thread.run(Thread.java:498)
+ 
+ when the request contains russina locale
+ (don't pay too much attention to line numbers I've got 'em a little bit wrong cause to my modifications .. ;) 
+ 
+ 
+ In short that is the line 
+              ServletOutputStream out=res.getOutputStream();
+               out.print(buf.toString());
+ 
+ 
+ I've also dumped the buf to a file (just for my pleasure), here it is:
+ =============================================
+ java.io.IOException: Not an ISO 8859_1 character:?                                                                                                                     
+ <html>                                                      
+ <head>                                                      <title>Directory Listing for:/</title>                                               </head><body bgcolor=white>                                              <table width=90% cellspacing=0 cellpadding=5 align=center><tr><td colspan=3><font size=+2><strong>Directory Listing for:/</strong></td></tr>                           
+ <tr><td colspan=3 bgcolor=#cccccc><font size=+2><strong>Subdirectories:</strong>                    </font></td></tr>                                           <tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt><a href="/cocoonsamples">cocoonsamples/</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt>                                   
+ </td><td><tt>&nbsp;&nbsp;</tt></td><td align=right><tt>??, 21 ??? 2000 00:39 GMT+04:00</tt></td></tr>                                    <tr><td colspan=3 bgcolor=#ffffff>&nbsp;</td></tr>                            <tr><td colspan=4 bgcolor=#cccccc><font size=+2><strong>Files:</strong></font></td></tr><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                            <tt><a href="/m.html">m.html</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td>                                                 <td align=right><tt>0.0 KB</tt></td><td align=right><tt>??, 23 ??? 2000 15:04 GMT+04:00</tt></td></tr>                                    <tr><td colspan=3 bgcolor=#ffffff>&nbsp;</td></tr><tr><td colspan=3 bgcolor=#cccccc><font size=-1>Tomcat Web Server v3.2 beta 6
+ </font></td></tr></table></body></html> 
+ 
+ Here we can see that some parts of the date got wrong...

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, email: tomcat-dev-help@jakarta.apache.org