Im sure that someone should be able to help me here, as it feels like such a simple answer, but i can't find it anywhere. I need to write a unicode string (null padded ascii basically), but it isn't working as expected, no matter what i try from the internets, it ends up as pure ascii.
with open('test.txt', 'wb') as oFile:
name = u'AAA'
oFile.write(name) //always writing 0x414141 i want 0x410041004100
Just to clarify, though the question is answered already, in case someone wanders here, the use case is it is a mixed binary file (an int here, a unicode string there, a struct, etc) and I am editing in place. I really just wanted to be able to write the string the way it is represented in the file ('AAA' as 0x410041004100 instead of 0x414141)
0x41be0x0041instead of0x4100?