You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by Masf <ma...@gmail.com> on 2018/10/18 14:33:15 UTC

Encoding issue reading text file

Hi everyone,

I´m trying to read a text file with UTF-16LE but I´m getting weird
characters like this:
��     W h e n

My code is this one:

    sparkSession
      .read
      .format("text")
      .option("charset", "UTF-16LE")
      .load("textfile.txt")

I´m using Spark 2.3.1. Any idea to fix it?

Thanks
-- 


Regards.
Miguel Ángel