[Lazarus] Lazarus (UTF8) and Windows: SysToUTF8, UTF8ToSys... Is there a better solution?

Sven Barth pascaldragon at googlemail.com
Wed Dec 25 22:45:08 CET 2013


Am 25.12.2013 19:35 schrieb "Marcos Douglas" <md at delfire.net>:
> > The only problem on Windows is that you must only pass a string with a
very
> > clear encoding to a RTL function.
> >
> > so
> >
> >  assignfile(f,s+s2+s3);
> >
> > is dangerous if they are not all the same encoding. If there is any
> > mismatch, it will be converted down to default encoding.
>
> Yes but where is the difference between 2.6.2 and trunk, in that case?

If in 2.6.2 your three strings contain text of different encodings then the
resulting string might be garbage from the user's POV.
In trunk the encoding is part of each string and if they differ then each
strings will be converted to the default string encoding (defined by a
global variable inside unit System) and thus the string might still be
valid.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20131225/14c161b0/attachment-0003.html>


More information about the Lazarus mailing list