|
Hans Ulrich Niedermann |
b61466 |
From 611a24a8d1f497582cd2deb3a57b9e16cc0f66db Mon Sep 17 00:00:00 2001
|
|
|
f6c950 |
From: Peter Lemenkov <lemenkov@gmail.com>
|
|
|
f6c950 |
Date: Sun, 21 Nov 2010 00:17:49 +0300
|
|
Hans Ulrich Niedermann |
b61466 |
Subject: [PATCH 11/11] Ugly workaround for java-1.5.0-gcj which doesn't support UNICODE fully
|
|
|
f6c950 |
|
|
|
f6c950 |
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
|
|
|
f6c950 |
---
|
|
|
f6c950 |
.../com/ericsson/otp/erlang/OtpErlangList.java | 14 +-------------
|
|
|
f6c950 |
.../com/ericsson/otp/erlang/OtpInputStream.java | 13 ++-----------
|
|
|
f6c950 |
2 files changed, 3 insertions(+), 24 deletions(-)
|
|
|
f6c950 |
|
|
|
f6c950 |
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangList.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangList.java
|
|
|
f6c950 |
index 3456fd7..86cd411 100644
|
|
|
f6c950 |
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangList.java
|
|
|
f6c950 |
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangList.java
|
|
|
f6c950 |
@@ -389,19 +389,7 @@ public class OtpErlangList extends OtpErlangObject implements
|
|
|
f6c950 |
*/
|
|
|
f6c950 |
|
|
|
f6c950 |
public String stringValue() throws OtpErlangException {
|
|
|
f6c950 |
- if (! isProper()) {
|
|
|
f6c950 |
- throw new OtpErlangException("Non-proper list: " + this);
|
|
|
f6c950 |
- }
|
|
|
f6c950 |
- final int[] values = new int[arity()];
|
|
|
f6c950 |
- for (int i = 0; i < values.length; ++i) {
|
|
|
f6c950 |
- final OtpErlangObject o = elementAt(i);
|
|
|
f6c950 |
- if (! (o instanceof OtpErlangLong)) {
|
|
|
f6c950 |
- throw new OtpErlangException("Non-integer term: " + o);
|
|
|
f6c950 |
- }
|
|
|
f6c950 |
- final OtpErlangLong l = (OtpErlangLong) o;
|
|
|
f6c950 |
- values[i] = l.intValue();
|
|
|
f6c950 |
- }
|
|
|
f6c950 |
- return new String(values, 0, values.length);
|
|
|
f6c950 |
+ throw new OtpErlangException("No UNICODE support in java-1.5.0-gcj");
|
|
|
f6c950 |
}
|
|
|
f6c950 |
|
|
|
f6c950 |
|
|
|
f6c950 |
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpInputStream.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpInputStream.java
|
|
|
f6c950 |
index b9b4348..c11702c 100644
|
|
|
f6c950 |
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpInputStream.java
|
|
|
f6c950 |
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpInputStream.java
|
|
|
f6c950 |
@@ -1074,17 +1074,8 @@ public class OtpInputStream extends ByteArrayInputStream {
|
|
|
f6c950 |
case OtpExternal.nilTag:
|
|
|
f6c950 |
return "";
|
|
|
f6c950 |
case OtpExternal.listTag: // List when unicode +
|
|
|
f6c950 |
- len = read4BE();
|
|
|
f6c950 |
- intbuf = new int[len];
|
|
|
f6c950 |
- for (int i = 0; i < len; i++) {
|
|
|
f6c950 |
- intbuf[i] = read_int();
|
|
|
f6c950 |
- if (! OtpErlangString.isValidCodePoint(intbuf[i])) {
|
|
|
f6c950 |
- throw new OtpErlangDecodeException
|
|
|
f6c950 |
- ("Invalid CodePoint: " + intbuf[i]);
|
|
|
f6c950 |
- }
|
|
|
f6c950 |
- }
|
|
|
f6c950 |
- read_nil();
|
|
|
f6c950 |
- return new String(intbuf, 0, intbuf.length);
|
|
|
f6c950 |
+ throw new OtpErlangDecodeException(
|
|
|
f6c950 |
+ "No UNICODE support in java-1.5.0-gcj");
|
|
|
f6c950 |
default:
|
|
|
f6c950 |
throw new OtpErlangDecodeException(
|
|
|
f6c950 |
"Wrong tag encountered, expected " + OtpExternal.stringTag
|
|
|
f6c950 |
--
|
|
Hans Ulrich Niedermann |
b61466 |
1.7.3.3
|
|
|
f6c950 |
|