Bug 23405 – Doc is wrong on use of useReplacementDchar

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-10-12T01:32:25Z
Last change time
2022-10-13T03:53:49Z
Assigned to
No Owner
Creator
Walter Bright

Comments

Comment #0 by bugzilla — 2022-10-12T01:32:25Z
Reported here: https://news.ycombinator.com/item?id=33170701 what I think is probably a docbug at this URL: https://dlang.org/phobos/std_utf.html#.byUTF "Throws: UTFException if invalid UTF sequence and useReplacementDchar is set to UseReplacementDchar.yes" My guess is that this is a mistake and should instead say UseReplacementDchar.no since it makes sense to throw an exception if you can't use U+FFFD here, rather than do both.
Comment #1 by razvan.nitu1305 — 2022-10-13T03:53:49Z
Both master and stable are fixed: https://github.com/dlang/phobos/blob/stable/std/utf.d#L4278 https://github.com/dlang/phobos/blob/master/std/utf.d#L4278 So I'm guessing it's just a deployment issue.