[Lazarus] Lazarus (UTF8) and Windows: SysToUTF8, UTF8ToSys... Is there a better solution?
Jürgen Hestermann
juergen.hestermann at gmx.de
Tue Dec 24 18:39:32 CET 2013
Am 24.12.2013 15:26, schrieb Marco van de Voort:
>> But in APIs it would not matter much to convert (in general the time for
>> conversion is negligible compared to the time that is needed for the
rest
>> around the API call).
> Maybe. (less so for fine grained structures, e.g. think a virtual
stringgrid
> with many nodes).
Well, I use VirtualStringGrid with millions of nodes in my program
and it works like a charm (with UTF8) on Windows.
>> I have written a file manager for Windows that can log and store
millions
>> of files in memory. It uses the (UTF16) unicode API from Windows and
>> converts the file names as UTF8 internally. There exists another file
>> manager who uses UTF16 internally too which can also log millions of
>> files.
> That's because the cost is hidden by slow harddisk movement.
When I log my whole hard disk multiple times the the logging comes
totally from memory.
There is no hard disk movement at all.
Still there is no difference.
>> IMO this decision is based on the assumption to choose one encoding
for everything.
> Well, that is a wrong (and arbitrary) assumption then. If you want to
play
> make believe and reorganize the world top-down be my guess, but leave
> practical design matters in the current world out of it. We simply
have to
> live in the world we live in, not the world that could have been
It is the world of exact such thinking.
People are creating this.
It's not a law of nature.
> Document encodings are for end users, programming
> interfaces are for programmers. Lazarus users are programmers, except for
> sourceencoding which IMHO can remain utf8 just happily (just like Delphi
> btw)
That's nonsense.
The *need* to convert between encodings should be restricted to just
that: Only when it is needed.
We should never force people (neither programmers nor users nor anyone)
to juggle encodings.
The aim should be to *reduce* conversions not to increase them.
More information about the Lazarus
mailing list