/** * Convert strings with ISO Latin 1 escape sequences back to original strings. * <p> * Section 5.5.7 of OBV spec. */ private static String convertFromISOLatin1(String name) { int index = -1; StringBuffer buf = new StringBuffer(name); while ((index = buf.toString().indexOf("\\U")) != -1) { String str = "0000" + buf.toString().substring(index + 2, index + 6); // Convert Hexadecimal byte[] buffer = new byte[(str.length() - 4) / 2]; for (int i = 4, j = 0; i < str.length(); i += 2, j++) { buffer[j] = (byte) ((ORBUtility.hexOf(str.charAt(i)) << 4) & 0xF0); buffer[j] |= (byte) ((ORBUtility.hexOf(str.charAt(i + 1)) << 0) & 0x0F); } buf = new StringBuffer(delete(buf.toString(), index, index + 6)); buf.insert(index, (char) buffer[1]); } return buf.toString(); }
/** * Convert strings with ISO Latin 1 escape sequences back to original strings. * <p> * Section 5.5.7 of OBV spec. */ private static String convertFromISOLatin1(String name) { int index = -1; StringBuffer buf = new StringBuffer(name); while ((index = buf.toString().indexOf("\\U")) != -1) { String str = "0000" + buf.toString().substring(index + 2, index + 6); // Convert Hexadecimal byte[] buffer = new byte[(str.length() - 4) / 2]; for (int i = 4, j = 0; i < str.length(); i += 2, j++) { buffer[j] = (byte) ((ORBUtility.hexOf(str.charAt(i)) << 4) & 0xF0); buffer[j] |= (byte) ((ORBUtility.hexOf(str.charAt(i + 1)) << 0) & 0x0F); } buf = new StringBuffer(delete(buf.toString(), index, index + 6)); buf.insert(index, (char) buffer[1]); } return buf.toString(); }
/** * Convert strings with ISO Latin 1 escape sequences back to original strings. * <p> * Section 5.5.7 of OBV spec. */ private static String convertFromISOLatin1(String name) { int index = -1; StringBuffer buf = new StringBuffer(name); while ((index = buf.toString().indexOf("\\U")) != -1) { String str = "0000" + buf.toString().substring(index + 2, index + 6); // Convert Hexadecimal byte[] buffer = new byte[(str.length() - 4) / 2]; for (int i = 4, j = 0; i < str.length(); i += 2, j++) { buffer[j] = (byte) ((ORBUtility.hexOf(str.charAt(i)) << 4) & 0xF0); buffer[j] |= (byte) ((ORBUtility.hexOf(str.charAt(i + 1)) << 0) & 0x0F); } buf = new StringBuffer(delete(buf.toString(), index, index + 6)); buf.insert(index, (char) buffer[1]); } return buf.toString(); }
/** * Convert strings with ISO Latin 1 escape sequences back to original strings. * <p> * Section 5.5.7 of OBV spec. */ private static String convertFromISOLatin1(String name) { int index = -1; StringBuffer buf = new StringBuffer(name); while ((index = buf.toString().indexOf("\\U")) != -1) { String str = "0000" + buf.toString().substring(index + 2, index + 6); // Convert Hexadecimal byte[] buffer = new byte[(str.length() - 4) / 2]; for (int i = 4, j = 0; i < str.length(); i += 2, j++) { buffer[j] = (byte) ((ORBUtility.hexOf(str.charAt(i)) << 4) & 0xF0); buffer[j] |= (byte) ((ORBUtility.hexOf(str.charAt(i + 1)) << 0) & 0x0F); } buf = new StringBuffer(delete(buf.toString(), index, index + 6)); buf.insert(index, (char) buffer[1]); } return buf.toString(); }