Skip to content

Tag: utf-8

Convert utf-16 to utf-8 using python

I am trying to convert a huge csv file from utf-16 to utf-8 format using python and below is the code: But this code uses lots of memory and fails with Memoryerror. Please help me with an alternate method. Answer an option is to convert the file line by line: or you could open the files with your desired enco…

How can I read a byte array file of strings?

There is a file with following contents: This is my try to read the lines and convert them to readable utf characters, but still it shows the same strings in the output file: The output file is: As you see, the problem exists for input line but not for target and prediction lines (however scrambled but that&#…