How to convert bytes to a string with Python

Configurare noua (How To)

Situatie

Using decode(), you can convert bytes into string. Here, we have used utf-8 for decoding. \xE2\x9C\x85 is the utf-8 code for

Backup

Using decode()

Input:
print(b'Easy \xE2\x9C\x85'.decode("utf-8"))

Output

Easy ✅

 

Solutie

Tip solutie

Permanent

Voteaza

(10 din 18 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?