https://issues.dlang.org/show_bug.cgi?id=15642
Issue ID: 15642
Summary: std.utf.encode should return ubyte
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: phobos
Assignee: [email protected]
Reporter: [email protected]
std.utf.encode accepts at most a char[4] array, then returns a size_t to let
you know how many elements were filled.
Let's say you have a char[4] in a struct, and you want to store how much was
encoded, would you use another 12 bytes (8 for the size_t, 4 for alignment) to
store the "valid elements" in the struct to hold a number from 1 to 4?
It should be backwards compatible with any code that uses a size_t.
--