4
I have a file that is completely written like this after my Crawler also written in Python has saved the data in it:
b'N\xc3\xa3o n\xc3\xa3o n\xc3\xa3o, n\xc3\xb3s iremos sim!'
I wonder if there is any way I can get the encoding out of this file and go to Unicode as soon as possible! If possible without having to install any program not to disturb the performance of my Crawler and my execution of this service.
I’ve tried using bytes.Find and then bytes.Decode, but as expected, it goes back to its initial state, and I also realized that the strings have no Decoding commands.
Your file in Python is in hexadecimal special characters
(\xc3\xa3o)
, and you want to write them normally, that’s it?– Brumazzi DB
Yes @Brumazzidb I need to take these characters and replace them with the Unicode versions of them, only my file has more than 140 thousand lines so then I needed some solution in python!
– Vinicius Mesel
There is no way to decode the contents of this file, it seems that it was written this way by dirty, all the content is structured to be used as string in python, o you will have to read the file and use replace to replace the hexadecimal sequences and quotes - Brumazzi DB 1 hour ago edit
– Brumazzi DB