bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug classpath/26218] File.toURL().openConnection().getInputStream() thr


From: freebeans at xqb dot biglobe dot ne dot jp
Subject: [Bug classpath/26218] File.toURL().openConnection().getInputStream() throws MalformedURLException
Date: 13 Mar 2006 16:09:03 -0000


------- Comment #4 from freebeans at xqb dot biglobe dot ne dot jp  2006-03-13 
16:09 -------
Problem of MalformedURLException is fixed, but this class cannot handle a
filename which includes non-ascii character.
--- Connection.java line 160 ---
        else if (c > 127) {
            try {
                byte [] c_as_bytes = Character.toString(c).getBytes("utf-8");
                System.arraycopy(c_as_bytes, 0, buf, pos, c_as_bytes.length);
            }
            catch (java.io.UnsupportedEncodingException x2) {
                throw (Error) new InternalError().initCause(x2);
            }
        }
----

"pos" should be updated after System.arraycopy().

--- Connection.java line 160 ---
        else if (c > 127) {
            try {
                byte [] c_as_bytes = Character.toString(c).getBytes("utf-8");
                System.arraycopy(c_as_bytes, 0, buf, pos, c_as_bytes.length);
                pos += c_as_bytes.length; // <-- fixed      }
            catch (java.io.UnsupportedEncodingException x2) {
                throw (Error) new InternalError().initCause(x2);
            }
        }
----


-- 

freebeans at xqb dot biglobe dot ne dot jp changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26218





reply via email to

[Prev in Thread] Current Thread [Next in Thread]