public UTF8String translate(Map<Character, Character> dict) {
    String srcStr = this.toString();

    StringBuilder sb = new StringBuilder();
    for(int k = 0; k< srcStr.length(); k++) {
      if (null == dict.get(srcStr.charAt(k))) {
        sb.append(srcStr.charAt(k));
      } else if ('\0' != dict.get(srcStr.charAt(k))){
        sb.append(dict.get(srcStr.charAt(k)));
      }
    }
    return fromString(sb.toString());
  }
public UTF8String translate ( Map < Character , Character > dict ) { String srcStr = this . toString ( ) ; StringBuilder sb = new StringBuilder ( ) ; for ( int k = 0 ; k < srcStr . length ( ) ; k ++ ) { if ( null == dict . get ( srcStr . charAt ( k ) ) ) { sb . append ( srcStr . charAt ( k ) ) ; } else if ( '\0' != dict . get ( srcStr . charAt ( k ) ) ) { sb . append ( dict . get ( srcStr . charAt ( k ) ) ) ; } } return fromString ( sb . toString ( ) ) ; }
TODO: Need to use `Code Point` here instead of Char in case the character longer than 2 bytes