Bug 23489 – std.format.sformat mishandles wchar ranges

Status
NEW
Severity
normal
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-11-15T20:15:15Z
Last change time
2024-12-01T16:40:43Z
Assigned to
No Owner
Creator
ag0aep6g
Moved to GitHub: phobos#9850 →

Comments

Comment #0 by ag0aep6g — 2022-11-15T20:15:15Z
Similar to issue 23488, but less urgent for me because I don't use wchars. struct R { wstring s = "😈"; bool empty() { return s.length == 0; } wchar front() { return s[0]; } void popFront() { s = s[1 .. $]; } } void main() { import std.format: sformat; char[4] buf; assert(sformat(buf, "%s", R()) == "😈"); /* fails; should pass */ }
Comment #1 by robert.schadek — 2024-12-01T16:40:43Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/9850 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB