title: Elasticsearch shows umlauts as "??"
body: <p><strong>Setup:</strong></p>
  
  <ul>
  <li>Ubuntu 12.04 Server installed via VMWare quick install </li>
  <li>PostgreSQL 9.1</li>
  <li>ElasticSearch 0.90 </li>
  <li>Mono 3.2.1 </li>
  <li>Rails 4 </li>
  <li>Nginx 1.4.2 + Passenger 4.0.16</li>
  </ul>
  
  <p>I have a C# program that on start writes a new ElasticSearch index and points the alias that is used by the rails applications to it, the program then keeps going and watches a redis instance for things to update.</p>
  
  <p>There is another C# program that scrapes data from web pages, once scraped they are put into Postgresql and the index writer above is notified via Redis. Those pages have varying encodings and are converted to UTF-8. </p>
  
  <p>The first appearance of this bug was when I made a mistake and encoded data that was already UTF-8 as UTF-8 again.</p>
  
  <p><strong>Investigation</strong></p>
  
  <p>Now I thought that I obviously have some data corruption going on but the weird thing is: The umlauts are only corrupted when I start the indexing mono process from rails via nohup, if I kill this process and manually start it from the command line it works perfectly fine. </p>
  
  <p>When I do a backup/restore of the database it works again from web interface but once the server is rebooted the umlauts are again replaced with ?? when starting the mono process from the web interface.</p>
  
  <p>The first thing I did was to purge the affected rows from the database and scrape the data again (without encoding it twice), that didn't help and since the error only appears when running it as non-interactive via nohup from the rails application I assumed it is because of the locale setting so I changed that in both, /etc/defaults/locale and /etc/environment to en_US.UTF-8 and en_US:en but that did not help either.</p>
  
  <p>I really have no idea what else I can do or what exactly causes this error, any help would be appreciated.</p>
  
  <p>edit: I forgot to clarify the most important part, when umlauts are replaced with ?? <strong>ALL</strong> umlauts are replaced in every single document in the index.</p>