S
S
SOmar2017-02-13 08:58:41
Python
SOmar, 2017-02-13 08:58:41

Python - cp866 encoding?

Python 3.4
There is a text "'®av ЋЎ¦®аЄ Љ®а®"m ‹Ґў" in our "Cake Glutton King Lion"
How in python to decrypt this text so to speak back and forth!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander, 2017-02-13
@SOmar

Here is the easiest option.

txt="Торт Обжорка Король Лев"
b=bytes(txt,"cp1251")
s=str(b,"cp866")
print(s)
b=bytes(s,"cp866")
s=str(b,"cp1251")
print(s)

A
abcd0x00, 2017-02-14
@abcd0x00

>>> "’®ав ЋЎ¦®аЄ  Љ®а®«м ‹Ґў".encode('cp1251').decode('cp866')
'Торт Обжорк  Король Лев'
>>>

A
Astrohas, 2017-02-13
@Astrohas

text.decode('cp866')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question