|
From: Jim K. <ji...@ho...> - 2006-07-13 21:19:19
|
Hey All-
I'm having an issue with XMLSerializer's handling of character encodings.
I'm sending antibiotic sensitivity results via OBX segments in ORU^R01
messages. The OBX needs to communicate the units used in the measurement
being reported. In one case, we need to use the character encoding known as
the micro sign. Hopefully, the email will render this correctly, but the
following xml snippet shows what I'd like to send, which is the HTML
character encoding for the micro sign:
<OBX.6>
<CE.1>µ/mL</CE.1>
</OBX.6>
Unfortunately, once the XMLSerializer is done with it I end up with this
(again if the characters are mangled, the example shows the ampersand for
the micro sign transformed into an HTML character encoding for ampersand
followed by the text string "micro;":
<OBX.6>
<CE.1>&micro;/mL</CE.1>
</OBX.6>
If you look at the source code for XMLSerializer you'll see that it doesn't
recognize or respect HTML encoding characters when it sees them. As soon as
it sees an ampersand, regardless of the context, it transforms it into its
HTML character encoding equvalent.
If I try simply sending through the character or its unicode equivalent the
serializer happily sends it through untouched, but the system I'm sending
to isn't able to cope with it and rejects the message. It will only accept
the html character encoding.
Does anyone have a work around for this that doesn't involve post processing
the XML representation of the message with some kind of search and replace?
Thanks.
|