No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Hi there, I have a file with unicode characters I used url decoder code below on a large file, but what is funny is that it doesn't decode some lines,but when I use the code on a file with just that line it decodes it correctly. import urllib.parse for lines … |
|
I have wrote a simple code in python s = b'B1=A\xF1adir+al+carrito\n'.decode('latin-1') print(s) with open ('lat.txt','wb') as f: f.write(bytes(s,'latin-1')) the output is **B1=AƱadir+al+carrito** and the content of the file is also the same. but when I try to read from a file (with this content B1=A\xF1adir+al+carrito ) for lines in open('mytxt1.txt','rb'): … |