unicodestring和rawbytestring相互转换

function unicode2raw(v: UnicodeString): RawByteString;
begin
SetLength(Result, length(v) shl 1);
Move(PUnicodeString(v)^, PRawByteString(result)^, Length(Result));
end;

function raw2unicode(v: RawByteString): UnicodeString;
begin
var len: Integer := Length(v);
SetLength(Result, len shr 1);
Move(PRawByteString(v)^, PUnicodeString(Result)^, len);
end;

  

相关文章:

  • 2021-12-04
  • 2021-07-22
  • 2021-06-07
  • 2021-11-01
  • 2021-06-12
  • 2021-07-20
  • 2022-01-07
  • 2022-01-20
猜你喜欢
  • 2022-12-23
  • 2022-02-10
  • 2021-08-14
  • 2021-06-21
  • 2022-03-01
  • 2021-11-30
相关资源
相似解决方案