Michael Blow has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/3300

Change subject: [NO ISSUE] Fix serialization of surrogate pairs on non-UTF8 
platforms
......................................................................

[NO ISSUE] Fix serialization of surrogate pairs on non-UTF8 platforms

Change-Id: I17228e7dfdcd220e1c0caf5fcc8207fb8f3a7733
---
M 
asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/PrintTools.java
M asterixdb/asterix-server/src/test/resources/NCServiceExecutionIT/cc.conf
M 
hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/process/HyracksCCProcess.java
3 files changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb 
refs/changes/00/3300/1

diff --git 
a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/PrintTools.java
 
b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/PrintTools.java
index b8e1b43..a9c4d15 100644
--- 
a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/PrintTools.java
+++ 
b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/PrintTools.java
@@ -21,6 +21,7 @@
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.PrintStream;
+import java.nio.charset.StandardCharsets;
 
 import 
org.apache.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
 import 
org.apache.asterix.dataflow.data.nontagged.serde.AFloatSerializerDeserializer;
@@ -399,7 +400,7 @@
         }
         final char lowSurrogate = UTF8StringUtil.charAt(src, lowSurrogatePos);
         final int lowSurrogateSize = UTF8StringUtil.charSize(src, 
lowSurrogatePos);
-        os.write(new String(new char[] { highSurrogate, lowSurrogate 
}).getBytes());
+        os.write(new String(new char[] { highSurrogate, lowSurrogate 
}).getBytes(StandardCharsets.UTF_8));
         return highSurrogateSize + lowSurrogateSize;
     }
 
diff --git 
a/asterixdb/asterix-server/src/test/resources/NCServiceExecutionIT/cc.conf 
b/asterixdb/asterix-server/src/test/resources/NCServiceExecutionIT/cc.conf
index f3dcd63..ff54eda 100644
--- a/asterixdb/asterix-server/src/test/resources/NCServiceExecutionIT/cc.conf
+++ b/asterixdb/asterix-server/src/test/resources/NCServiceExecutionIT/cc.conf
@@ -22,6 +22,7 @@
 nc.api.port=19004
 jvm.args=-Xloggc:/tmp/asterix-server-failsafe/asterix_nc1-%p-gc.log 
-XX:+PrintGC -XX:+PrintGCDateStamps -XX:GCLogFileSize=10M -XX:+PrintFlagsFinal
 #jvm.args=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5006
+jvm.args=-Dfile.encoding=iso-8859-1
 
 [nc/asterix_nc2]
 ncservice.port=9091
@@ -31,6 +32,7 @@
 nc.api.port=19005
 jvm.args=-Xloggc:/tmp/asterix-server-failsafe/asterix_nc2-%p-gc.log 
-XX:+PrintGC -XX:+PrintGCDateStamps -XX:GCLogFileSize=10M -XX:+PrintFlagsFinal
 #jvm.args=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5007
+jvm.args=-Dfile.encoding=utf-16
 
 [nc]
 address=127.0.0.1
diff --git 
a/hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/process/HyracksCCProcess.java
 
b/hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/process/HyracksCCProcess.java
index 2ac6f2b..a79d033 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/process/HyracksCCProcess.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/process/HyracksCCProcess.java
@@ -49,5 +49,6 @@
         args.add("-Xmx1024m");
         cList.addAll(args);
         // 
cList.add("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005");
+        cList.add("-Dfile.encoding=us-ascii");
     }
 }

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/3300
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I17228e7dfdcd220e1c0caf5fcc8207fb8f3a7733
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: stabilization-f69489
Gerrit-Owner: Michael Blow <[email protected]>

Reply via email to