In this example, you will learn to convert bytes to a string.
To understand this example, you should have the knowledge of the following Python programming topics:
Using decode()
print(b'Easy \xE2\x9C\x85'.decode("utf-8"))
Output
Easy ✅
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 ✅.
Related posts:
Python Dictionary update()
Python compile()
Convert XML to JSON Using Jackson
Python any()
Python next()
Python List sort()
Python Program to Check the File Size
Machine Learning with Python for everyone - Mark E.Fenner
Python Program to Safely Create a Nested Directory
Python Set discard()
Python Set clear()
Convert Character Array to String in Java
Python String partition()
Python Global, Local and Nonlocal variables
Deep Learning from Scratch - Building with Python form First Principles - Seth Weidman
Python Function Arguments
Python Machine Learning Cookbook - Practical solutions from preprocessing to Deep Learning - Chris A...
Python String capitalize()
Python Program to Convert Kilometers to Miles
Python Program to Count the Number of Digits Present In a Number
Convert String to int or Integer in Java
Python Program to Find the Factors of a Number
Python help()
Python Program to Find HCF or GCD
Python Program to Delete an Element From a Dictionary
Python Program to Sort a Dictionary by Value
Learning scikit-learn Machine Learning in Python - Raul Garreta & Guillermo Moncecchi
Python getattr()
Python Exception Handling Using try, except and finally statement
Python String maketrans()
Python String swapcase()
Python String isdecimal()