How to convert UTF8 special characters to the actual character
We are receiving the report in text format and it has special characters like ', - like that in the text. Source system is using the UTF8 encoding format hence the text is showing as ' � ' . Is there a way to convert the utf8 to actual character in the DTL.
Thank you,
Comments
Character set conversion should be /configured/applied in the receiving service/adapter.
Unfortunately you did not provide any useful details, so it's impossible to help.
This is TCP HL7 Service using class 'EnsLib.HL7.Service.TCPService' and adapter is EnsLib.HL7.Adapter.TCPInboundAdapter. while occuring the issue I set Default Char Encoding as "!iso-8859-1" but it is not working as expected. It is converting utf8 charctaer to '?'.
For the incoming HL7 messages, does the field MSH:CharacterSet (MSH:18) contains a value? Is so, what's the value?
You write that the receiver message is encoded using utf-8, have you tried to configure the "Default Char Encoding" setting in the Business Service to "utf-8"?
If the incoming HL7 message is actually/really encoded using utf-8 and MSH:18 contains a value different than "utf-8", you can enforce conversion configuring the "Default Char Encoding" setting in the Business Service to "!utf-8".
I hope the message is not malformed and contains data/fields with different codes, if so...it can be tricky.
Hi Enrico,
Thanks for your response,
The inbound message doesn't have MSH:18 value. I tried using UTF-18 but didn't work. Is there any possibility to resolve the issue to decode the characters correctly?
First you MUST be positively sure on what the character set is actually used in the incoming HL7 message.
What's the character set of the incoming message?
If it's really utf-8 then setting "Default Char Encoding" to utf-8 should work, if it does not, then evidently the incoming message use a different character set.
Just in case, try setting "Default Char Encoding" to "!utf8"
Thank you! I will try this.