summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2014-06-19 21:26:52 +0200
committerAndrew Branson <andrew.branson@cern.ch>2014-06-19 21:26:52 +0200
commit115b91f138f59c3a65252ff8d20c617ee483ebc5 (patch)
tree87df0e5703ecd95a6c8e9e084e42b05ab5cb8619
parent0dc68367e18793975ed93a65940d1b9a245b1b19 (diff)
Force UTF-8 for client and server CORBA communication. By default the
Sun ORB uses ISO-8859
-rw-r--r--src/main/java/com/c2kernel/process/Gateway.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main/java/com/c2kernel/process/Gateway.java b/src/main/java/com/c2kernel/process/Gateway.java
index 8182bf8..5ad6e87 100644
--- a/src/main/java/com/c2kernel/process/Gateway.java
+++ b/src/main/java/com/c2kernel/process/Gateway.java
@@ -145,7 +145,8 @@ public class Gateway
//TODO: externalize this (or replace corba completely)
sysProps.put("com.sun.CORBA.POA.ORBServerId", "1");
sysProps.put("com.sun.CORBA.POA.ORBPersistentServerPort", serverPort);
-
+ sysProps.put("com.sun.CORBA.codeset.charsets", "0x05010001, 0x00010109"); // need to force UTF-8 in the Sun ORB
+ sysProps.put("com.sun.CORBA.codeset.wcharsets", "0x00010109, 0x05010001");
//Standard initialisation of the ORB
mORB = org.omg.CORBA.ORB.init(new String[0], sysProps);
@@ -358,8 +359,13 @@ public class Gateway
static public org.omg.CORBA.ORB getORB()
{
if (orbDestroyed) throw new RuntimeException("Gateway has been closed. ORB is destroyed.");
- if (mORB == null)
- mORB = org.omg.CORBA.ORB.init(new String[0], null);
+ if (mORB == null) {
+ java.util.Properties sysProps = System.getProperties();
+ sysProps.put("com.sun.CORBA.codeset.charsets", "0x05010001, 0x00010109"); // need to force UTF-8 in the Sun ORB
+ sysProps.put("com.sun.CORBA.codeset.wcharsets", "0x00010109, 0x05010001");
+ mORB = org.omg.CORBA.ORB.init(new String[0], sysProps);
+ }
+
return mORB;
}