[fpc-pascal] Funny things about utf-8 strings on mac

Florian Klaempfl florian at freepascal.org
Wed Jun 13 11:26:50 CEST 2007

Jonas Maebe schrieb:
> On 13 jun 2007, at 07:32, Daniƫl Mantione wrote:
>> Op Wed, 13 Jun 2007, schreef Felipe Monteiro de Carvalho:
>>> How would I then be sure that my string is never converted (or always
>>> converted from utf-8 to utf-8 if prefered), but just passed like I
>>> wrote it to the library that I am using?
>> Add the cwstring unit, and run it in an utf-8 terminal.
> Sorry, but this view is too "terminal-centric" as far as I am concerned.
> That's not something you want to tell users of a GUI app. Or even
> programmers, for that matter. I really don't see a reason why this
> should not be configurable by the programmer himself.

Well, then something with the design is wrong. Ansistrings are per
definition strings which use the default 8 bit encoding of the
environment. Putting always utf-8 into them is abusing them and that's
why there is an utf8string type in the system unit.

More information about the fpc-pascal mailing list