Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7015408

(str) ICU4J UTF16.valueOf(codePoint);

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 7
    • core-libs
    • generic
    • generic

      In plain Java I really miss a few of the ICU4J routines, like:

          * char c1 = UTF16.getLeadSurrogate(codePoint);
          * char c2 = UTF16.getLeadSurrogate(codePoint);
          * String s = UTF16.valueOf(codePoint);

      You can do them in plain Java, as in the above expression, but they're awkward and not as clear to read. And instead of the third one, the best I see in plain Java is the following, which is really pretty ugly (is there any better way?).


      String s = new StringBuilder().appendCodePoint(codePoint).toString();

            Unassigned Unassigned
            sherman Xueming Shen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: