Show: Object Pascal C++
Display Preferences

W1057 Implicit string cast from '%s' to '%s' (Object Pascal)

From Appmethod Topics
Jump to: navigation, search

Go Up to Error and Warning Messages (Object Pascal) Index

Emitted when the compiler detects a case where it must implicitly convert an AnsiString (or AnsiChar) to some form of Unicode (a UnicodeString or a WideString). This warning is on by default.

To avoid this warning, you need to explicitly typecast your AnsiString to the new string type (UnicodeString), as follows:

<your_target_string> := string(<your_ansi_source);

The warning is also given for assigning UTF8String value to a UnicodeString or WideString. location, in which case you can use an explicit cast to UTF8String.

Personal tools
In other languages