I'm trying to read an array of bytes character by character and decode it to a unicode string, as below:
current_character = byte_array[0:1].decode("utf-8")
For each character, I'm trying to check whether the result of .decode("utf-8") equals the empty string, but I can't seem to be able to detect this. When I print out the result of decoding, I get the empty string. But how do I translate this detection into code?
I've tried:
if not current_character
if current_character is u""
But they both don't work. Any suggestions?
current_character = byte_array.decode("utf-8")[0:1]?byte_array?