diff options
author | nsandonato | 2011-01-05 21:52:09 +0000 |
---|---|---|
committer | nsandonato | 2011-01-05 21:52:09 +0000 |
commit | 991ce2b531c061c9a38ea8c30e23b7cd1870d55a (patch) | |
tree | 3485bea82c91046c8d4ddf61fb9990144944d18b | |
parent | d82c10a2574f95cb7a89d313d6da9b3f0bac8289 (diff) | |
download | webtools.sourceediting-991ce2b531c061c9a38ea8c30e23b7cd1870d55a.tar.gz webtools.sourceediting-991ce2b531c061c9a38ea8c30e23b7cd1870d55a.tar.xz webtools.sourceediting-991ce2b531c061c9a38ea8c30e23b7cd1870d55a.zip |
[333132] [translation] Double Byte characters are not persisted correctly during JSP Translation
-rw-r--r-- | bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java index bd40057b7e..99c35ee7b4 100644 --- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java +++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java @@ -124,7 +124,7 @@ public class JSPTranslator implements Externalizable { * @see #writeRanges(ObjectOutput, HashMap) * @see #readRanges(ObjectInput) */ - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 2L; /** for debugging */ private static final boolean DEBUG = Boolean.valueOf(Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/jspjavamapping")).booleanValue(); //$NON-NLS-1$ @@ -3378,7 +3378,7 @@ public class JSPTranslator implements Externalizable { private static void writeString(ObjectOutput out, String s) throws IOException { if(s != null) { out.writeInt(s.length()); - out.writeBytes(s); + out.writeChars(s); } else { out.writeInt(0); } @@ -3400,9 +3400,11 @@ public class JSPTranslator implements Externalizable { */ private static String readString(ObjectInput in) throws IOException { int length = in.readInt(); - byte[] bytes = new byte[length]; - in.readFully(bytes); - return new String(bytes); + char charArray[] = new char[length]; + for(int i=0; i < length;i++){ + charArray[i] = in.readChar(); + } + return new String(charArray); } /** |