Bytes to string using Python3.x

Just to let you know, that i am working on a code upgradation project.

The previous code was developed in Python2.x and now we are upgrading it to Python3.x

I one of the functionality there, we were using the standard decode() function to convert bytes to string, which was working fine all the time in the previous Python2.x code. But in the updated code in Python3.x, I am getting error as 

Python 2.x code snippet:

encoder = 'utf-8'
unicode('test message', encoder)

Error Message:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_31208/3890802735.py in <module>
      1 encoding = 'utf-8'
----> 2 unicode('hello', encoding)

NameError: name 'unicode' is not defined