Python Forum

Full Version: get original code after being encoded to UTF-8
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
There you go then. Something is storing the file as a binary, rather than text. How are you creating the file and saving it?
i have created the file by Geany editor in raspbian and i save it with .py extension.
when i opened it in windows i get encrypted file.
try utf-16
utf-16 does nt work.
i have tried a lot of encoding format but none of them work.
(Sep-07-2020, 09:53 AM)ashok Wrote: [ -> ]i have created the file by Geany editor in raspbian and i save it with .py extension.

Something is wrong on the Linux side then because file shouldn't be saying the file is "data". I haven't used Geany, but I'd be surprised if a text editor is doing that.
As mention something most be wrong on the Linux side,i can use eg Geany in both Mint or Kail.
Have choose Python as Scripting language in editor,all other setting default in Geany(encoding default is utf-8).
No problem when move file .py to Windows,just a normal Python file no encryption/encoding stuff going on.
i think there's no solution for this.
So, how can i avoid my code get encrypted ?
Did you create this file?
If so, perhaps show how you created it.
Plus, I doubt the file is being encrypted. I don't know what you're doing to end up with a binary, but encryption is likely not it.
Pages: 1 2