Hi,<br><br>I have opened a unicode file for writing:<br><br>import codecs<br>file = codecs.open( "somefile.dat", "wb", "utf-16" )<br><br>and I attempt to do this:<br><br>file.write( struct.pack
( "I", 5000 ) )<br><br>However, this won't work because the encoding of the string returned by "pack" isn't unicode. I'm a bit confused right now as to how I can get this to work. I can't allow the unicode-ness of the file interfere with the actual order of the bytes that pack() is returning (In other words, don't pack NULL characters in there)
<br><br>Thanks.<br>