title: GNU gettext msgfilter program says "invalid multibyte sequence"
body: <p>GNU gettext program msgfilter seems not to accept UTF8 string as a result of the script that is given as a filter. The script just returns a prepared text which is read from a file.  </p>
  
  <p>Here is the test setup:</p>
  
  <pre><code>echo '#!/bin/bash
  cat /tmp/t3.txt
  ' &gt; /tmp/trans01.sh
  chmod a+rwx /tmp/trans01.sh
  </code></pre>
  
  <p>Then there is a file /tmp/t3.txt:</p>
  
  <pre><code>cat /tmp/t3.txt
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>AMSTERDAM REISEFÜHRER FÜR REISE, UNTERKUNFT, SEHENSWÜRDIGKEITEN     
  </code></pre>
  
  <p>It is utf-8 file:</p>
  
  <pre><code>file /tmp/t3.txt
  </code></pre>
  
  <p>Gives:</p>
  
  <pre><code>/tmp/t3.txt: UTF-8 Unicode text
  </code></pre>
  
  <p>Further:</p>
  
  <pre><code>echo 'msgid "kk71ams_amsterdam_main_page_title"
  msgstr "AMSTERDAM TOURIST GUIDE FOR TRAVEL, ACCOMMODATION, ATTRACTIONS"
  ' &gt; /tmp/te1.po
  </code></pre>
  
  <p>Than:</p>
  
  <pre><code>cat /tmp/te1.po
  </code></pre>
  
  <p>Gives:</p>
  
  <pre><code>msgid "kk71ams_amsterdam_main_page_title"
  msgstr "AMSTERDAM TOURIST GUIDE FOR TRAVEL, ACCOMMODATION, ATTRACTIONS"
  </code></pre>
  
  <p>Than:</p>
  
  <pre><code>file /tmp/te1.po
  </code></pre>
  
  <p>Gives:</p>
  
  <pre><code>/tmp/te1.po: GNU gettext message catalogue, ASCII text
  </code></pre>
  
  <p>Locale:</p>
  
  <pre><code>:~# locale
  LANG=
  LANGUAGE=
  LC_CTYPE="POSIX"
  LC_NUMERIC="POSIX"
  LC_TIME="POSIX"
  LC_COLLATE="POSIX"
  LC_MONETARY="POSIX"
  LC_MESSAGES="POSIX"
  LC_PAPER="POSIX"
  LC_NAME="POSIX"
  LC_ADDRESS="POSIX"
  LC_TELEPHONE="POSIX"
  LC_MEASUREMENT="POSIX"
  LC_IDENTIFICATION="POSIX"
  LC_ALL=
  </code></pre>
  
  <p>Now the problem with 'msgfilter':</p>
  
  <pre><code>~# msgfilter -i /tmp/te1.po '/tmp/trans01.sh'
  msgid "kk71ams_amsterdam_main_page_title"
  /tmp/te1.po:2: invalid multibyte sequence
  /tmp/te1.po:2: invalid multibyte sequence
  /tmp/te1.po:2: invalid multibyte sequence
  /tmp/te1.po:2: invalid multibyte sequence
  /tmp/te1.po:2: invalid multibyte sequence
  /tmp/te1.po:2: invalid multibyte sequence
  /tmp/te1.po:2: invalid multibyte sequence
  /tmp/te1.po:2: invalid multibyte sequence
  /tmp/te1.po:2: invalid multibyte sequence
  /tmp/te1.po:2: invalid multibyte sequence
  /tmp/te1.po:2: invalid multibyte sequence
  /tmp/te1.po:2: invalid multibyte sequence
  msgstr "AMSTERDAM REISEFHRER FR REISE, UNTERKUNFT, SEHENSWRDIGKEITEN\n"
  </code></pre>