简体   繁体   中英

HL7 HAPI - Unicode character \E appearing?

I'm making a character conversion to unicode using Java, sometimes I get a character "\\E" in the converted String, what does this character mean? - I searched and could not find an answer.

String conc = String.format ("\\u%04x", (int)charArray[i]);

  • This is an example of the output I'm getting: \\E\م\\E\ل\\E\ف\\E\ \\E\ت\\E\ج\\E\ر\\E\ب\\E\ة\\E\ \\E\ل\\E\ت\\E\ق\\E\ن\\E\ي\\E\ة\\E\
  • The output is correct if I remove all the "\\E"

All your backslashes are getting escaped to \\E\\ as this is the escape sequence used in HL7 for a backslash character.

For more information on escape sequences used for special characters in HL7 you can refer to this link: https://corepointhealth.com/resource-center/hl7-resources/hl7-escape-sequences/

I found the answer so I'm sharing it for anyone who comes across a similar problem. I was using HAPI - an HL7 lib for Java- which has a particular behavior of escaping the / with a /E when converting xml to a HL7v2 message, as the default seperator is the slash "/", that's why I was getting all the /E's.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM