I’m getting some weird behaviour recompiling some applications in 2009 that used widestrings at various points.
In a Delphi 2009 App is Widestring identical to String?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, they are not idenitical.
WideStringis just a wrapper for the ActiveX/COMBSTRtype. You need it when working with with strings in ActiveX/COM.Stringin Delphi 2009 and later is an alias forUnicodeString, which can hold Unicode characters, just likeBSTRdoes, but it’s NOT the same asWideString.WideStringis allocated by the COM memory manager, and is not reference counted.UnicodeStringis allocated by the RTL memory manager, and is reference counted, just likeAnsiStringis.You should use
(Unicode)Stringwherever possible, and only useWideStringfor COM interop, or dealing with legacy libraries that useWideStringfor Unicode support.