title: Spark: importing text file in UTF-8 encoding
body: <p>I am trying to process a file which contains a lot of special characters such as German umlauts(ä,ü,o) etc. as follows :</p>
  
  <p><code>sc.hadoopConfiguration.set("textinputformat.record.delimiter", "\r\n\r\n")</code> <code>sc.textFile("/file/path/samele_file.txt")</code></p>
  
  <p>But upon reading the contents, these special characters are not recognized.</p>
  
  <p>I think the default encoding is not in UTF-8 or similar formats. I would like to know if there is a way to set encoding on this textFile method such as:</p>
  
  <pre><code>sc.textFile("/file/path/samele_file.txt",mode="utf-8")`
  </code></pre>