Closed piglione73 closed 3 months ago
Hi @piglione73
Please send us a sample message for testing purposes.
MSH|^~\&|HELIOS|DEDALUS|||20240609213244||ADT^A01|HL7Gtw018FFE7D23AC00|P|2.5|||AL|AL|D|8859/1
EVN|A01|||RO||20240609213200
PID|1||5928948^^^X1V1_MPI^PI~1053251221^^^HELIOS^ANT~757HA514^^^SS^SS~WLMHLP81R56Z209U^^^NNITA^NNITA||ANONYMIZED ANONYMIZED^ANONYMIZED ANONYMIZED^^^^^^^^^^^^3||19811016|F|||V. ANTONIO BAZZINI 9&V. ANTONIO BAZZINI&9^^ANONYMIZED^^20125^^H^^015146~V. ANTONIO ANONYMIZED 9&V. ANTONIO BAZZINI&9^^ANONYMIZED^^12345^^L^^015146^030~^^SRI LANKA^^^^BDL^^999311||^PRN^PH^^^^^^^^^3279945913|||2||ANONYMIZED^MEF^NNITA|757HA514|||||||^^311^SRI LANKA (gi\X00E0\ CEYLON)||||N
PV1|1|I|XOSTPIO^^^ICHPIO^^^^^ANONYMIZED|4|P2024126713||ANONYMIZED^ANONYMIZED^TOMMASO||||1HB^602^D02|||3|||ANONYMIZED^ANONYMIZED^ANONYMIZED||G2024005887^^^PRZ^VN|1||||||||||||||||||||||||20240609213200
The wrong part should be like this when decoded:
SRI LANKA (già CEYLON)
Please try with the new version 3.0.3
Hi @jaime-olivares, I confirm it now works. Thanks!
Thanks for your work on this issue! We ran into an issue yesterday of a few HL7 files not being able to parse and it was because of this encoding bug. Updating the library unblocked us.
Hi, the HL7Encoding.Decode function apparently misinterprets the "X" escape sequences.
I have a message that contains
\X00E0\
, which should be decoded as "à".However, the Decode function is like this:
So, it processes hexadecimal digits two at a time, and then decodes the two bytes as UTF-8, thus resulting in two wrong characters, the first of which is \0. But the expected result should be the single "à" character.
Shouldn't it decode the four hex digits as a single unicode char, without even mentioning UTF8?