StringUtils { public static String asUnicodes(String in) { if(in == null) return null; StringBuilder result = new StringBuilder(); for (int offset = 0; offset < in.length(); ) { int codepoint = in.codePointAt(offset); result.append("\\U+").append(Integer.toHexString(codepoint).toUpperCase()); offset += Character.charCount(codepoint); } return result.toString(); } private  StringUtils(); static String asUnicodes(String in); static String normalizeLineEndings(String in); static String isolateRTLIfRequired(String s); static boolean isRtl(String string);  }
@Test public void asUnicodes() { assertEquals("\\U+20\\U+E6\\U+65\\U+5EA", StringUtils.asUnicodes(" æeת")); }