Python Forum
get original code after being encoded to UTF-8
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
get original code after being encoded to UTF-8
#1
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 ?
Reply
#2
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.
Reply
#3
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 ?
Reply
#4
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.
Reply
#5
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
Reply
#6
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?
Reply
#7
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?
Reply
#8
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?
Reply
#9
i don't know, i don't have a raspberry card now .. maybe tomorrow i can tell
Reply
#10
when i run file on the file in a terminal iget data as result, like this:
prg.py: data
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question Can you put encoded strings into .txt files? Alivegamer 0 1,264 May-04-2022, 12:50 AM
Last Post: Alivegamer
  Looping through nested elements and updating the original list Alex_James 3 2,141 Aug-19-2021, 12:05 PM
Last Post: Alex_James
  filecmp is not working for UTF-8 BOM encoded files sureshnagarajan 3 2,617 Feb-10-2021, 11:17 AM
Last Post: sureshnagarajan
  HELP! i need the solution to show for original indexing bntayfur 1 1,525 Oct-02-2020, 06:44 PM
Last Post: buran
  Why is my original list also sorted? Pedroski55 1 1,620 Jul-15-2020, 09:25 PM
Last Post: Yoriz
  Trouble with encoded data (I think) fishglue 0 1,805 Oct-10-2019, 08:15 PM
Last Post: fishglue
  convert hex encoded string to ASCII Skaperen 4 114,361 Oct-02-2016, 09:22 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020