Question
· May 26, 2020

accented characters

How do you allow accented chracters to flow through the engine without erroring out? I read something about adding a "!" in MSH-18 to accept the default coding, but now it gives me an error about "No translation table found".  Does InterSystems have anything out of the box to account for accented letters?  Does this need to be coded?

Discussion (6)1
Log in or sign up to continue

Hi Cedric,

It sounds like you are adjusting the messages to have ! in the MSH:18 field. Unless I'm misunderstanding, that seems like a misinterpretation of the DefCharEncoding documentation, which I will include here:

Default Char Encoding

Normally the encoding found in MSH:18 is used, but an "!" at the start of the DefCharEncoding setting will forcibly use whatever encoding you specify.

Hope that helps.

DefCharEncoding is a setting for HL7 services that you would add the ! to in order to enforce a particular encoding. If MSH:18 is blank then whatever encoding is in DefCharEncoding will be used, whether or not you use ! for the setting. ! in the message in MSH:18 would probably trigger an error as ! doesn't represent a valid encoding.

Typically all strings are UTF encoded.
The average text often consist of  single-byte characters  (a subset of UTF-8)   
As soon as a multibyte character joins the string the whole string just uses WIDE characters

example:

USER>set txt="cher ami j'ai besoin de 100 eur"
USER>zw txt
txt="cher ami j'ai besoin de 100 eur"
 
USER>zzdump txt
0000: 63 68 65 72 20 61 6D 69 20 6A 27 61 69 20 62 65         cher ami j'ai be
0010: 73 6F 69 6E 20 64 65 20 31 30 30 20 65 75 72            soin de 100 eur

USER>set txt="cher ami j'ai besoin de 100 €"
USER>zw txt
txt="cher ami j'ai besoin de 100 €"
 
USER>zzdump txt
0000: 0063 0068 0065 0072 0020 0061 006D 0069                 cher ami
0008: 0020 006A 0027 0061 0069 0020 0062 0065                  j'ai be
0010: 0073 006F 0069 006E 0020 0064 0065 0020                 soin de
0018: 0031 0030 0030 0020 20AC                                100 €

 

The conversion happens totally internal.
depending on your needs you can select the national language table.
different languages sort differently.   e.g German äöü vs. aou