I'm attempting to write a program where the code reads from a pre-existing text file, and then writes the text in that file as utf-8 in a new text file. How would I go about doing this? My apologies I am extremely new to python and I'm unaware of any modules that could help accomplish this task.
Asked
Active
Viewed 64 times
0
-
Possible duplicate of http://stackoverflow.com/questions/191359/how-to-convert-a-file-to-utf-8-in-python – kingmakerking May 21 '17 at 21:24
-
If you're new to Python, don't board a sinking ship – learn Python 3, not 2. – lenz May 22 '17 at 22:23
1 Answers
1
You could check out this question asked previously: How to convert a file to utf-8 in Python?
But to summarize you should see the codecs
library and particularly codecs.open()
which allows specification of a file type.