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
hello every one,
i have problem, i can't get access to my python code.
when i reopen the editor i found it encode it to UTF-8.
any suggestions ?
UTF-8 is the norm for python.
did you inadvertently open with a 'w' mode?
if you did and don't have a backup, you may have destroyed your data.
If you made this mistake, the file will have a length of 0.
if a text file, you can look at it with any text editor.
no i can run python code, file has length more than 0. i don't think data is being destroyed!
it's python file, it's there a way to decode the file and get the code ?
If it's in UTF-8, then there's nothing else to do. Why would you need to decode it? I think you need to show us the file.
Db�mA��v�\��X(�OF^I��a�%"S����r߲}��݌\ �p�>6�C�i�(��	c��b�/c��%�:��������<- �����<c8������&��Q�L=WK�|(Y� ���� �9X���2-��N��U�݄�
f_KQ��TȔ�(����/i�f���l�T�dq��j��-�T,
�c�@���|���G4�l��?Ggd����v�x��m'AV��,��F�3���g�HT�~�����U�-[���Jު���[�� �=�Y@z&I�\�P3�ފ�~�H�̯pT`�dV���cX&��Ž-����lM�G}�f�&�T��m�I�����A���k���c���!�"��������n�9�Mp�����N���]7i����؅������sD������g�#�N%��υo�"�K۵�q��.�����޿/�ގ���&���^?��5�GX�l����M~���Lfk��]�pH`%�mi�ɷ*՗�ql	�E{�O`f�?�D-=y���O�U��u�O��w����������r����0�.q�;���&�H�zӖ���&��Az�C���1"X��Ϲ[���>��K���}D��
�m�zQ0E}O����|����(���#6�=�,ew+����J�w�[�e��wʴ�8>=[H��M�K�O�Ѕ�<�q8���I6|Ȱ��V��g>�1h�}d��7��`v3� �HS����>���6���69
����l�V��pb-��,���jKŇ�d�Eζ=�!�H1����s
here's how it looks!
is there a solution to get access to my code!?
i spent a long time in searching but with no results yet .... Huh Huh
Which editor are you using? If it is really UTF-8, can't you just tell the editor that that's what the encoding is?

Otherwise, what did you do to end up with this? What OS are you on?
between windows (python IDLE) and rasbian (geany).
maybe it ended up like this because i work on the same code file between the two OS!!! right?
I doubt that's the case really. I haven't used IDLE (I gather it's a pretty poor IDE). On Raspbian, if you run file on the file in a terminal, what does it say?
i don't know, i don't have a raspberry card now .. maybe tomorrow i can tell
when i run file on the file in a terminal iget data as result, like this:
prg.py: data
Pages: 1 2