[333132] [translation] Double Byte characters are not persisted correctly during JSP Translation
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 bd40057..99c35ee 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 @@
* @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 @@
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 @@
*/
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);
}
/**