types - Problem reading a TStream in Delphi XE -
in previous versions of delphi, following code:
var inbuf: array[1..45] of byte; count := instream.read(inbuf, sizeof(inbuf));
filled variable inbuf correct values ( every byte had value ). in delphi xe, every second byte of array 0, suppose because byte data type twice big, because of unicode nature in delphi xe. but, streams generated , need pass through procedure, need type (maybe?) half size of byte or solution if faced problem. thanks
what has happened here, >99% probability have written stream string variable. unicode strings utf-16 encoding have 2 bytes per character whereas older versions of delphi using ansi encodings 1 byte per character.
english text, when encoded utf-16 have pattern observe of every second byte being zero.
in order solve need investigate section of code writes stream.
Comments
Post a Comment