I am trying to read a file with an encoding of UTF-16 in a Spark dataframe. However, when I display the result of my dataframe, I get unwanted special characters in my result-set.
I have tried the following - using UTF-16BE:
df = spark.read.format('text').option("encoding", 'UTF-16BE').option("charset", 'UTF-16').option('delimiter', "\|").option('header', 'false').option("quote", "\"").option("escape", "\"").load(filepath)
And have tried the following using UTF-16LE:
df = spark.read.format('text').option("encoding", 'UTF-16LE').option("charset", 'UTF-16').option('delimiter', "\|").option('header', 'false').option("quote", "\"").option("escape", "\"").load(filepath)
Both attempts return the unwanted special characters.
I would really appreciate any help.