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

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -