On 01/06/2012 06:53 PM, Hans-Peter Diettrich wrote: > > You're right, the XE compiler lacks some error checks :-( > If this indeed is considered a bug in Delphi, FPC _could_ in fact in a more sane way provide the length of an "AnsiString(CP_UTF16)" in terms of Words (i.e. UTF codes, as done with UTF8), -Michael