콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3162 화면

Hello,
How can we convert bytes into string (Python 3).
My string is in signature.
I am using
signature = signature.decode(encoding="utf-8")
But it gives me error:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xde in position 1: invalid continuation byte

Any idea please.

아바타
취소

what is your input, please specify? if you are reading a file, then you can specify the encoding directly.

작성자

Hi @Hilar Andikkadavath:

Thank you for ur kind reply, my input is a hash, which is in bytes formate.