Delphi XE - should I use String or AnsiString?

前端 未结 6 1596
广开言路
广开言路 2021-02-14 00:12

I finally upgraded to Delphi XE. I have a library of units where I use strings to store plain ANSI characters (chars between A and U). I am 101% sure that I will never ever use

6条回答
  •  感动是毒
    2021-02-14 01:02

    Use AnsiString explicitly everywhere in this unit and then you'll get compiler warning errors (which you should never ignore) for String to AnsiString conversion errors if you happen to access the routines incorrectly.

    Alternately, perhaps preferably depending on your situation, simply convert everything to UTF8.

提交回复
热议问题