Remove null characters from WideString in Delphi 2006

前端 未结 2 1257
-上瘾入骨i
-上瘾入骨i 2021-01-13 13:45

I have a WideString variable containing some data but when the string was assigned some extra nulls where added at more or less random places in the data. I now need to stri

2条回答
  •  情歌与酒
    2021-01-13 14:12

    Those are not extra nulls. They're part of the string.

    You should do some reading on multi-byte characters, which includes WideStrings. Characters are more than one byte in size, and some of those extra bytes are NULLs.

    You might start here with Nick Hodges' articles on Unicode, written when Delphi 2009 was first released to help people transition from single-byte characters to multi-byte ones. There are three articles in the series, IIRC.

提交回复
热议问题