[fpc-devel] TRegistry and Unicode

Marco van de Voort core at pascalprogramming.org
Tue Feb 26 14:47:07 CET 2019


Op 2/26/2019 om 11:04 AM schreef Michael Van Canneyt:
>
>
> If I understood the OP correct, he wants to change the use of "string"
> arguments in the public API to unicodestring.
>
> That changes a lot.
>
> Contrary to popular belief, the conversion will not automatically be
> correct, and will produce errors.
>
> (See e.g. https://bugs.freepascal.org/view.php?id=35113
> for a similar situation where part of the error is that the lazarus
> user must explicitly call Utf8Decode.)

(seems to indicate that that is utf8string, and not "string" with 
lazarus defaultsystemcodepage to utf8. I can imagine anything

wrong inserting a conversion over "string" and thus mangling the result)

>
> So my proposal is to leave the public API as-is, using string, adding
> unicode string overloads where possible/useful.
>
> Internally, convert to whatever fits best.
>
> if the internal routines are easier to maintain/understand if they use
> unicode string throughout: refactor them to use unicode.
>
Leave as is:  only works with lazarus hack. Other people wo

upgrade to unicodestring :works for both cases (regardless of 
defaultsystemcodepage)






More information about the fpc-devel mailing list