<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Mark,<br>
    <br>
    The high/lowSurrogate(codepoint) pair has been added in jdk1.7
    already.<br>
    <br>
    <a
href="http://download.java.net/jdk7/docs/api/java/lang/Character.html#highSurrogate%28int%29">http://download.java.net/jdk7/docs/api/java/lang/Character.html#highSurrogate(int)</a><br>
    <a
href="http://download.java.net/jdk7/docs/api/java/lang/Character.html#lowSurrogate%28int%29">http://download.java.net/jdk7/docs/api/java/lang/Character.html#lowSurrogate(int)</a><br>
    <br>
    I submitted CR#7015408 for the third (formatting) one.<br>
    <br>
    -Sherman<br>
    <br>
    On 01/26/2011 01:36 PM, Mark Davis ☕ wrote:
    <blockquote
      cite="mid:AANLkTinDQxh6obahUMQ0yEHJkvHfo8Ry4BfR6JWixzjU@mail.gmail.com"
      type="cite"><font class="Apple-style-span" face="arial, helvetica,
        sans-serif">Ok, now I understand. With that change, the
        situation is much better. It doesn't fully satisfy 
        <meta charset="utf-8">
        <span class="Apple-style-span" style="border-collapse:
          collapse;">RL1.1, because you can't use hex codepoint numbers
          -- you have to use the fairly ugly workaround of</span></font>
      <div>
        <span class="Apple-style-span" style="font-family:
          arial,sans-serif; border-collapse: collapse;"><br>
        </span></div>
      <meta charset="utf-8">
      <font class="Apple-style-span" color="#500050" face="'courier
        new', monospace"><span class="Apple-style-span"
          style="border-collapse: collapse;">
          <meta http-equiv="Content-Type" content="text/html;
            charset=UTF-8">
          <meta http-equiv="Content-Style-Type" content="text/css">
          <title></title>
          <meta name="Generator" content="Cocoa HTML Writer">
          <meta name="CocoaVersion" content="1038.32">
          <style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco}
span.s1 {color: #4239f5}
span.s2 {color: #991664}
</style>
          <p class="p1">
            <meta http-equiv="Content-Type" content="text/html;
              charset=UTF-8">
            <meta http-equiv="Content-Style-Type" content="text/css">
            <title></title>
            <meta name="Generator" content="Cocoa HTML Writer">
            <meta name="CocoaVersion" content="1038.32">
            <style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco}
span.s1 {color: #4239f5}
span.s2 {color: #991664}
</style></p>
          <p class="p1">String hexPattern = codePoint &lt;= 0xFFFF </p>
          <p class="p1">? String.format(<span class="s1">"\\u%04x"</span>,
            codePoint) </p>
          <p class="p1">: String.format(<span class="s1">"\\u%04x\\u%04x"</span>,
            (<span class="s2">int</span>)
            Character.toChars(codePoint)[0], (<span class="s2">int</span>)
            Character.toChars(codePoint)[1]);</p>
        </span></font>
      <div>
        <div><span class="Apple-style-span" style="font-family:
            georgia,serif;"><br>
          </span></div>
        <div><span class="Apple-style-span" style="font-family:
            arial,helvetica,sans-serif;"><br>
          </span></div>
        <div><span class="Apple-style-span" style="font-family:
            arial,helvetica,sans-serif;">BTW, in plain Java I really
            miss a few of the ICU4J routines, like:</span></div>
        <div>
          <meta http-equiv="Content-Type" content="text/html;
            charset=UTF-8">
          <meta http-equiv="Content-Style-Type" content="text/css">
          <title></title>
          <meta name="Generator" content="Cocoa HTML Writer">
          <meta name="CocoaVersion" content="1038.32">
          <style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco}
span.s1 {text-decoration: underline}
</style>
          <p class="p1">
            <meta http-equiv="Content-Type" content="text/html;
              charset=UTF-8">
            <meta http-equiv="Content-Style-Type" content="text/css">
            <title></title>
            <meta name="Generator" content="Cocoa HTML Writer">
            <meta name="CocoaVersion" content="1038.32">
            <style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco}
</style></p>
          <ul>
            <li><font class="Apple-style-span" face="arial, helvetica,
                sans-serif">char c1 = UTF16.getLeadSurrogate(codePoint);</font></li>
            <li><font class="Apple-style-span" face="arial, helvetica,
                sans-serif">char c2 = UTF16.getLeadSurrogate(codePoint);</font></li>
            <li><font class="Apple-style-span" face="arial, helvetica,
                sans-serif">String s = UTF16.valueOf(codePoint);</font></li>
          </ul>
          <p class="p1"><font class="Apple-style-span" face="arial,
              helvetica, sans-serif"><span class="Apple-style-span"
                style="font-size: small;">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?).</span></font></p>
          <p class="p1"><font class="Apple-style-span" face="arial,
              helvetica, sans-serif"><span class="Apple-style-span"
                style="font-size: small;"><br>
              </span></font></p>
          <p class="p1"><font class="Apple-style-span" face="arial,
              helvetica, sans-serif"><span class="Apple-style-span"
                style="font-size: small;">
                <meta http-equiv="Content-Type" content="text/html;
                  charset=UTF-8">
                <meta http-equiv="Content-Style-Type" content="text/css">
                <title></title>
                <meta name="Generator" content="Cocoa HTML Writer">
                <meta name="CocoaVersion" content="1038.32">
                <style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco}
span.s1 {color: #991664}
span.s2 {text-decoration: underline}
</style></span></font></p>
          <p class="p1"><font class="Apple-style-span" face="arial,
              helvetica, sans-serif">String s = <span class="s1">new</span>
              <span class="s2">StringBuilder</span>().appendCodePoint(codePoint).toString();</font></p>
          <p class="p1"><font class="Apple-style-span" face="arial,
              helvetica, sans-serif"><span class="Apple-style-span"
                style="font-size: small;"><br>
              </span></font></p>
          <p class="p1"><font class="Apple-style-span" face="arial,
              helvetica, sans-serif"><span class="Apple-style-span"
                style="font-size: small;"></span><span
                class="Apple-style-span" style="font-size: small;">Mark</span></font></p>
          <br>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>