What is the best way to convert TBytes (UTF-16) to a string?

后端 未结 3 1534
北荒
北荒 2021-01-05 01:36

What is the best way to convert an array of bytes declared as TBytes to a unicode string in Delphi 2009? In my particular case, the TBytes array has UTF-16 encoded data alre

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-05 02:39

    I ended up using

    TEncoding.Unicode.GetString( MyByteArray );
    

提交回复
热议问题