You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See: https://forum.dlang.org/post/mvkbemmgatrfbxnmjada@forum.dlang.org
In the implementation of std.string.tr the main loop is:
foreach (dchar c; str)
meaning char and wchar strings are getting decoded. This leads to problems as reported on the n.g. link.
The correct way to implement it is to just leave it in the encoding of `str`. This should result in a significant speed improvement.
This leaves open what to do if `from` and `to` contain invalid UTF sequences if the conversion of them is necessary. The most pragmatic solution is to reject `from` and `to` arguments to `tr` that are not of the same UTF encoding as `str`.
The text was updated successfully, but these errors were encountered:
bugzilla (@WalterBright) reported this on 2019-08-18T22:29:00Z
Transfered from https://issues.dlang.org/show_bug.cgi?id=20140
Description
The text was updated successfully, but these errors were encountered: