Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornsandonato2011-01-05 21:52:09 +0000
committernsandonato2011-01-05 21:52:09 +0000
commit991ce2b531c061c9a38ea8c30e23b7cd1870d55a (patch)
tree3485bea82c91046c8d4ddf61fb9990144944d18b
parentd82c10a2574f95cb7a89d313d6da9b3f0bac8289 (diff)
downloadwebtools.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.java12
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);
}
/**

Back to the top