NextGen Connect 3.10.1 Released!

NextGen (Mirth) Connect 3.10.1 is now available as an appliance update and on our GitHub page. This release contains bug fixes. See the release notes for the list of fixes.

Download | See What's New | Upgrade Guide | Release Notes

For discussion on this release, see this thread.
See more
See less

problem with Umlaut characters

  • Filter
  • Time
  • Show
Clear All
new posts

  • problem with Umlaut characters


    I've got a problem with Umlauts in a preprocessing script.
    the channel reads a csv file. a preprocessing script is supposed to convert it to xml.
    when the csv contains umlauts like 'ü', they appear in the 'View message->Raw message' tab as '?'.
    I've even tries to replace umlauts with other characters like 'ue'. this doesn't work, so I think the problem might appear before the message gets into the preprocessor.

    the different encodings in the channel source didn't help either.

    message source (csv) :
    123;14.05.2007;0;123456;Mustermann;Maria;Überweg 5;54321;Köln

    raw message in mirth:
            <street>?berweg 5</street>
    How can I make sure to keep the umlauts ?

  • #2
    Reroblem with Umlaut characters

    First of all ¿Wich encoding are you using in your CVS file? To discover it, you can use the "file" command if you're under linux (or windows using cygwin) or with an editor like Jedit.

    The problem you're talking about is related with the viewer, not with the Mirth engine. Mirth, in its internal process can handle different encodings, but the Mirth console doesn't show it well.

    To test if Mirth is woking fine with this characters try the next in your channel: output the XML you've transformed to a file writter, writting the XML. Then try open your xml with IE, Firefox, or a XML editor (Oxygen, XMLSpy, etc.)

    If this doen't works, plese, post an example of your CSV file, and your channel.


    • #3
      Reroblem with Umlaut characters

      file encoding is ISO-8859 text
      I've set up a file writer that writes out the transformed xml as you suggested. the characters in that file are not showing correctly, they appear as '?'. I viewed them in ultra-edit which is usually able to show any encoding.

      Here's my csv:
      623;14.05.2007;0;12345;Wohl;Andreas;Freepsum 4;48596;Krummhörn
      624;14.05.2007;0;45678;Bök;Gudrun;West 14A;40596;Barssel
      625;14.05.2007;0;43214;Bölsch;Armin;Ahlener 12;09876;Dörpen
      626;14.05.2007;0;54678;Fedder;Frank;Wurmweg 4;50968;Köln
      Here's my channel:

            <property name="fileAge">0</property>
            <property name="autoDelete">1</property>
            <property name="moveToDirectory">C:/backup</property>
            <property name="pollingFrequency">600000</property>
            <property name="host">c:/incoming</property>
            <property name="moveToPattern">${DATE}-${SYSTIME}-${ORIGINALNAME}</property>
            <property name="checkFileAge">0</property>
            <property name="DataType">File Reader</property>
            <property name="processBatchFiles">1</property>
            <property name="charsetEncoding">DEFAULT_ENCODING</property>
            <property name="sortAttribute">date</property>
            <property name="binary">0</property>
            <property name="fileFilter">RG.csv</property>
                <script>for each (message in msg[&apos;Patient&apos;]){
      router.routeMessage(&quot;Next_Channel&quot;, message);
                <data class="map">
                    <string>for each (message in msg[&apos;Patient&apos;]){
      router.routeMessage(&quot;Next_Channel&quot;, message);
            <inboundTemplate>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#x0D;&lt;!--  Generated using Mirth PreProc   --&gt;&#x0D;&lt;Hi_in&gt;&#x0D;    &lt;Patient&gt;&#x0D;        &lt;rechnungsnummer&gt;rechungsnummer&lt;/rechnungsnummer&gt;&#x0D;        &lt;datum&gt;datum&lt;/datum&gt;&#x0D;        &lt;betrag&gt;betrag&lt;/betrag&gt;&#x0D;        &lt;fall_nummer&gt;p_nummer&lt;/fall_nummer&gt;&#x0D;        &lt;name&gt;name&lt;/name&gt;&#x0D;        &lt;vorname&gt;vorname&lt;/vorname&gt;&#x0D;        &lt;strasse&gt;strasse&lt;/strasse&gt;&#x0D;        &lt;plz&gt;plz&lt;/plz&gt;&#x0D;        &lt;ort&gt;ort&lt;/ort&gt;&#x0D;    &lt;/Patient&gt;&#x0D;&lt;/Hi_in&gt;</inboundTemplate>
          <transportName>File Reader</transportName>
            <name>Destination 1</name>
              <property name="host">sink</property>
              <property name="channelName">None</property>
              <property name="DataType">Channel Writer</property>
            <transportName>Channel Writer</transportName>
          <property name="synchronous">true</property>
          <property name="encryptData">false</property>
          <property name="dont_store_filtered">false</property>
          <property name="store_messages">true</property>
          <property name="initialState">started</property>
          <property name="max_message_age">-1</property>
          <property name="transactional">false</property>
          <property name="error_messages_only">false</property>
        <preprocessingScript>message = message.replace(/[\\r\\n]/g, &quot;\\n&quot;«»);
      message = replaceUmlauts(message, 0);
      var columnnames = new Array(&quot;rechnungsnummer&quot;,&quot;datum&quot;,&quot;betrag&quot;,&quot;fall_nummer&quot;,&quot;name&quot;,&quot;vorname&quot;,&quot;strasse&quot;,&quot;plz&quot;,&quot;ort&quot;«»);
      var nofcolumns = 9;
      var lines = new Array();
      var newmessage = new String();
      var i;
      newmessage = &quot;&lt;!--  Generated using Mirth PreProc   --&gt;\\n&quot;; 
      newmessage += &quot;&lt;Hi_in&gt;\\n&quot;;
      rawData = message;
      // Auskommentierte Zeilen für mehrere Zeilen pro File
       lines = rawData.split(&quot;\\n&quot;«»); 
      for (i=0;i&lt;lines.length;i++) {
      	currline = lines[i];
      	newmessage += &quot;&lt;Patient&gt;\\n&quot;;
      	var data = new Array();
      	data = currline.split(&quot;;&quot;«»);
      //	data = rawData.split(&quot;;&quot;«»);
      	for (var j = 0; j &lt; nofcolumns; j++){
      		newmessage += &quot;&lt;&quot; + columnnames[j] + &quot;&gt;&quot; + data[j] + &quot;&lt;/&quot; + columnnames[j] + &quot;&gt;\\n&quot;;
      	newmessage += &quot;&lt;/Patient&gt;\\n&quot;;
      newmessage += &quot;&lt;/Hi_in&gt;\\n&quot;;
      return newmessage
      function replaceUmlauts(string, index){
      		    var anArray = new Array(2);
      		    anArray[0] = new Array(&quot;Ö&quot;, &quot;ö&quot;, &quot;Ä&quot;, &quot;ä&quot;, &quot;Ü&quot;, &quot;ü&quot;, &quot;ß&quot;«»);
      		    anArray[1] = new Array(&quot;Oe&quot;, &quot;oe&quot;, &quot;Ae&quot;, &quot;ae&quot;, &quot;Ue&quot;, &quot;ue&quot;, &quot;sz&quot;«»);
      		    for (var i=0; i&lt;anArray[index].length; i++){
      				myRegExp = new RegExp(anArray[index][i],&quot;g&quot;«»);
      				string = string.replace(myRegExp, anArray[(index==0?1:0)][i]);
      		    return string;


      • #4
        i've got the same problem. And havn't found a solution till now.
        is there any solution to solve this?



        • #5
          This may have been resolved in

          If you were using the Send Message feature to manually process a message, Mirth Connect 2.1.0 would not preserve the special characters.
          Jacob Brauer
          Director, Software Development
          NextGen Healthcare