PropertiesSeparatorManagerState () { PropertiesSeparatorManagerState encodedState = new PropertiesSeparatorManagerState(); for (final Map.Entry<String, String> entry : mySeparators.entrySet()) { String separator = entry.getValue(); StringBuilder encoded = new StringBuilder(separator.length()); for (int i=0;i<separator.length();i++) { char c = separator.charAt(i); encoded.append("\\u"); encoded.append(String.format("%04x", (int) c)); } encodedState.getSeparators().put(entry.getKey(), encoded.toString()); } return encodedState; }