title: spark read wholeTextFiles with non UTF-8 encoding
body: <p>I want to read whole text files in non UTF-8 encoding via</p>
  
  <pre><code>val df = spark.sparkContext.wholeTextFiles(path, 12).toDF
  </code></pre>
  
  <p>into spark. How can I change the encoding?
  I would want to read ISO-8859 encoded text, but it is not CSV, it is something similar to xml:SGML.</p>
  
  <h1>edit</h1>
  
  <p>maybe a custom Hadoop file input format should be used?</p>
  
  <ul>
  <li><a href="https://dzone.com/articles/implementing-hadoops-input-format-and-output-forma" rel="nofollow noreferrer">https://dzone.com/articles/implementing-hadoops-input-format-and-output-forma</a></li>
  <li><a href="http://henning.kropponline.de/2016/10/23/custom-matlab-inputformat-for-apache-spark/" rel="nofollow noreferrer">http://henning.kropponline.de/2016/10/23/custom-matlab-inputformat-for-apache-spark/</a></li>
  </ul>