UnicodeString::printf() is a wrapper for the C-style vsnwprintf() function. In all of C++Builder's C-style printing functions, %s uses a non-standard implementation - it depends on whether the Narrow or Wide version of the function is being called, whereas in the C standard, %s always expects char* instead.
In this case, UnicodeString::printf() calls the Wide vsnwprintf() function, so %s expects a wchar_t* (however, %ls always expects a wchar_t*, per C standards, and %hs always expects a char*, per Borland standards). This way, in String::printf() (and other printing methods), %s is supposed to match the character type of String - char* for AnsiString, wchar_t* for UnicodeString*.
*However, on Android, Embarcadero has not implemented the Wide vsnwprintf(), only the Narrow vsnprintf(), so UnicodeString::printf() (and other printing methods) end up expecting a UTF-8 char* for %s! (which I reported as QC #124607 and RSP-13285).
UnicodeStringtype in standard C++, so you must be using some extension library. Try consulting that lib's documentation. Also, try%hs, which works for at least oneswprintf()implementation, but that's a shot in the dark...%hsworks fine. Thanks.TCHARwhere a #define switches between wide-char and narrow-char builds. So "%ls" is wide char (always), "%hs" is narrow char (always), and "%s" is "whatever the #define has selected".