code: private static int getExtendedChar(String name, int choice)
      {
          if (name.charAt(0) == '<') {
              if (choice == UCharacterNameChoice.EXTENDED_CHAR_NAME) {
                  int endIndex = name.length() - 1;
                  if (name.charAt(endIndex) == '>') {
                      int startIndex = name.lastIndexOf('-');
                      if (startIndex >= 0) { // We've got a category.
                          startIndex ++;
                          int result = -1;
                          try {
                              result = Integer.parseInt(
                                          name.substring(startIndex, endIndex),
                                          16);
                          }
                          catch (NumberFormatException e) {
                              return -1;
                          }
                          // Now validate the category name. We could use a
                          // binary search, or a trie, if we really wanted to.
                          String type = name.substring(1, startIndex - 1);
                          int length = TYPE_NAMES_.length;
                          for (int i = 0; i < length; ++ i) {
                              if (type.compareTo(TYPE_NAMES_[i]) == 0) {
                                  if (getType(result) == i) {
                                      return result;
                                  }
                                  break;
                              }
                          }
                      }
                  }
              }
              return -1;
          }
          return -2;
      }
docs: Getting the character with extended name of the form <....>.
  @param name of the character to be found
  @param choice name choice
  @return character associated with the name, -1 if such character is not
  found and -2 if we should continue with the search.