I want to concatenate two strings like this:
requestData = command + ' ' + data
"data" in my case holds binary data, that should not be opened - it should just glue it to command. But imho python is attempting to open it and it fails with:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xbc in position 1: ordinal not in range(128)
Is there a way to glue it without opening?
Edit: Python 2.7 Also my data is actualy not utf-8 decode might not help - its binary data.
In [1]: 'привет' + ' ' + 'Veseliq' Out[1]: '\xd0\xbf\xd1\x80\xd0\xb8\xd0\xb2\xd0\xb5\xd1\x82 Veseliq'.commandunicode? If yes,encodeit first.