[jacorb-bugs] [Bug 969] Incorrect UTF-8 conversion for non-BMP characters

bugzilla-daemon at jacorb.org bugzilla-daemon at jacorb.org
Mon Feb 17 16:16:53 CET 2014


http://www.jacorb.org/bugzilla/show_bug.cgi?id=969

--- Comment #2 from Gotthard Witsch <gotthard.witsch at ith-icoserve.com> ---
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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spline.inf.fu-berlin.de/pipermail/jacorb-bugs/attachments/20140217/d86243a7/attachment.html>


More information about the jacorb-bugs mailing list