convertCharToTraditionalChinese static method

String convertCharToTraditionalChinese(
  1. String c
)

将单个简体字转换为繁体字 @param c 需要转换的简体字 @return 转换后的繁字体

Implementation

static String convertCharToTraditionalChinese(String c) {
  if (chineseMap.containsValue(c)) {
    Iterable<MapEntry<String, String>> iterable = chineseMap.entries;
    for (int i = 0, length = iterable.length; i < length; i++) {
      MapEntry<String, String> entry = iterable.elementAt(i);
      if (entry.value == c) {
        return entry.key;
      }
    }
  }
  return c;
}