1 package net.sf.openrocket.utils;
3 import java.text.Normalizer;
5 import net.sf.openrocket.util.Chars;
8 * This class is used to generate the map used in L10N class
9 * due to the fact that Android does not support java.text.Normalizer.
11 public class L10NGenerator {
13 public static void main(String[] args) throws Exception {
16 for (char ch = 128; ch < 0x250; ch++) {
19 // Superscript numbers
20 for (char ch = 0x2070; ch <= 0x2079; ch++) {
24 for (char ch = 0x2080; ch <= 0x2089; ch++) {
27 output(Chars.FRACTION);
28 print(Chars.ZWSP, " ");
29 print(Chars.NBSP, " ");
32 private static void output(char ch) {
33 String text = "" + ch;
34 StringBuilder sb = new StringBuilder(text.length());
36 text = Normalizer.normalize(text, Normalizer.Form.NFKD);
38 for (char c : text.toCharArray()) {
41 } else if (c == Chars.FRACTION) {
46 text = sb.toString().trim();
48 if (text.length() > 0) {
53 private static void print(char ch, String text) {
54 System.out.printf("m.put('\\u%04x', \"%s\");\n", (int) ch, text);