<html>
    <head>
      <base href="http://www.jacorb.org/bugzilla/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Incorrect UTF-8 conversion for non-BMP characters"
   href="http://www.jacorb.org/bugzilla/show_bug.cgi?id=969#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Incorrect UTF-8 conversion for non-BMP characters"
   href="http://www.jacorb.org/bugzilla/show_bug.cgi?id=969">bug 969</a>
              from <span class="vcard"><a class="email" href="mailto:gotthard.witsch@ith-icoserve.com" title="Gotthard Witsch <gotthard.witsch@ith-icoserve.com>"> <span class="fn">Gotthard Witsch</span></a>
</span></b>
        <pre>To solve the conversion problem I attached a patch.
The following changes have been done:

In org.jacorb.org.CDROutputStream the conversion of the string is done by the
methodcall codeSet.write_string.
Therefore the class org.jacorb.orb.giop.CodeSet received a new method
write_string with the following signature:
 public void write_string( OutputBuffer buffer, String s, boolean write_bom,
boolean write_length, int giop_minor ).
In it's default implementation it does the same as in CDROutputStream has been
done earlier. Every character of the string is converted with the write_char
method.
The inner class Utf8CodeSet overrides this methode an uses the String's
getBytes(Charset charset) method to receive the necessary bytes for
transmission. With the buffer's write_byte method the bytes are added to the
buffer. The getBytes(Charset charset) is prefered to getBytes(String
charsetName), as getBytes(String charsetName) does not specify what will happen
if characters cannot be encoded.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>