[Issue 16210] std.utf.byUTF can be made into a bidirectional range

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Mar 11 14:24:33 PST 2017


https://issues.dlang.org/show_bug.cgi?id=16210

Jakub Łabaj <uaaabbjjkl at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |uaaabbjjkl at gmail.com

--- Comment #1 from Jakub Łabaj <uaaabbjjkl at gmail.com> ---
Assuming "ö" == [0xC3, 0xB6], which one version would be correct:
a) behaviour of std.utf.byCodeUnit, just go by code units backward:
"ö".byUTF!char().back == 0xB6

b) decode the character and return its first code unit:
"ö".byUTF!char().back == 0xC3

Personally I thought the b) version is desired (docs says that byUTF encodes
input), but at the moment it passes some inputs to byCodeUnit - it means for
some ranges byUTF is bidirectional already and version a) applies.

--


More information about the Digitalmars-d-bugs mailing list