Python Forum
get original code after being encoded to UTF-8 - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: get original code after being encoded to UTF-8 (/thread-29492.html)

Pages: 1 2


get original code after being encoded to UTF-8 - ashok - Sep-05-2020

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 ?


RE: get original code after being encoded to UTF-8 - Larz60+ - Sep-05-2020

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.


RE: get original code after being encoded to UTF-8 - ashok - Sep-05-2020

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 ?


RE: get original code after being encoded to UTF-8 - ndc85430 - Sep-05-2020

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.


RE: get original code after being encoded to UTF-8 - ashok - Sep-05-2020

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


RE: get original code after being encoded to UTF-8 - ndc85430 - Sep-05-2020

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?


RE: get original code after being encoded to UTF-8 - ashok - Sep-05-2020

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?


RE: get original code after being encoded to UTF-8 - ndc85430 - Sep-05-2020

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?


RE: get original code after being encoded to UTF-8 - ashok - Sep-05-2020

i don't know, i don't have a raspberry card now .. maybe tomorrow i can tell


RE: get original code after being encoded to UTF-8 - ashok - Sep-07-2020

when i run file on the file in a terminal iget data as result, like this:
prg.py: data