[fpc-pascal] cwstrings unit and UTF8Decode()
Marco van de Voort
marcov at stack.nl
Fri Mar 25 15:14:14 CET 2016
In our previous episode, Graeme Geldenhuys said:
> >> > Yes, this is correct.
> > Correction, this particular function does not depend on cwstrings.
> > All the other widestring (uppercase, compare etc) functions do.
> Ok, thanks for that.
> Is there an easy way to see when a RTL function requires cwstrings to
> function correctly? Is it mentioned in the RTL documentation? Is looking
> at the RTL source code the only way to find that out?
Yes, I think so. But in this case because utf8 to utf16 doesn't require
tables, it makes more sense it doesn't need some unicode library
As soon as it starts interpreting/comparing/mutating characters, you need
tables, and those can be better taken from the OS (or be at least optional
for small files that only want to use sysutils to remove a file or so)
More information about the fpc-pascal