So, we needed to do some UTF-8 code matchings. And someone grabbed the proper UTF-8 document and was talking code points. And then you notice that java 7 has no nice way to determine code points... *really*, it's only been 7 versions and it's still not well. At least, a snippet to show the proper code point: public static String printCharacters(final String s) { for (final int codepoint : codePoints(s)) { // we need Character.toChars and new String since we cannot call back to the specific character from the string from the iterator. System.out.println(new String(Character.toChars(codepoint)) + "is of type: "+ typeToString(Character.getType(codepoint)); } } /** java 7 doesn't have a nice support for determining code points. Java 8 does... */ publ...
This is a simple blog to help me remember those cool code snippets which I used. Either by copy, or by cobbling... I do not intend this to be read by people except for me and my bad mind.