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)



_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to