Detecting empty string when decoding byte array into unicode? (Python) -



Detecting empty string when decoding byte array into unicode? (Python) -

i'm trying read array of bytes character character , decode unicode string, below:

current_character = byte_array[0:1].decode("utf-8")

for each character, i'm trying check whether result of .decode("utf-8") equals empty string, can't seem able observe this. when print out result of decoding, empty string. how translate detection code?

i've tried:

if not current_character if current_character u""

but both don't work. suggestions?

try this:

if current_character == '': print('empty string')

python unicode

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -