mega.py
mega.py copied to clipboard
Chinese decode problem
I used the get_files() method to get all the nodes But the name of the Chinese file or folder will return unexpected text For example: I expected to get "中文資料夾" but I got "ä¸æ–‡è³‡æ–™å¤¾" Is this a base64 encoding problem? How can this be solved? Thank you
For anyone wondering how to do this do the following:
b = bytes(file_name, encoding="raw_unicode_escape")
actual_file_name = b.decode()
actual_file_name should be your desired string as it appears in Mega. I hope this fixes other people's problems, because this took way too long for me to figure out!