summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalibor Topic <robilad@yahoo.com>2006-03-06 02:42:18 +0000
committerDalibor Topic <robilad@yahoo.com>2006-03-06 02:42:18 +0000
commit7fa9aa855645f1c9f047e52a10f6da717b93edc6 (patch)
treed5e9640f85a06ef5130dfe5c823c1e1c499b467a
parent883632351558eb13c07ac21f5346c78500da3344 (diff)
downloadclasspath-7fa9aa855645f1c9f047e52a10f6da717b93edc6.tar.gz
fixed bug in file connection unicode character decoding
2006-03-06 Dalibor Topic <robilad@kaffe.org> * gnu/java/net/protocol/file/Connection.java (unquote): Update position in buffer after decoding a unicode character outside of the basic plane.
-rw-r--r--ChangeLog6
-rw-r--r--gnu/java/net/protocol/file/Connection.java4
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 3ae2935ff..8395b46b1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-03-06 Dalibor Topic <robilad@kaffe.org>
+
+ * gnu/java/net/protocol/file/Connection.java (unquote):
+ Update position in buffer after decoding a unicode character
+ outside of the basic plane.
+
2006-03-06 Robert Schuster <robertschuster@fsfe.org>
* javax/swing/plaf/basic/BasicTextUI.java:
diff --git a/gnu/java/net/protocol/file/Connection.java b/gnu/java/net/protocol/file/Connection.java
index f7253b093..04278d46a 100644
--- a/gnu/java/net/protocol/file/Connection.java
+++ b/gnu/java/net/protocol/file/Connection.java
@@ -160,7 +160,9 @@ public class Connection extends URLConnection
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);
+ final int c_length = c_as_bytes.length;
+ System.arraycopy(c_as_bytes, 0, buf, pos, c_length);
+ pos += c_length;
}
catch (java.io.UnsupportedEncodingException x2) {
throw (Error) new InternalError().initCause(x2);