August 15, 2019
https://issues.dlang.org/show_bug.cgi?id=20134

          Issue ID: 20134
           Summary: autodecode should use replacementDchar rather than
                    throwing on invalid
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody@puremagic.com
          Reporter: bugzilla@digitalmars.com

Currently, when the autodecoder encounters an invalid UTF sequence, it throws a UTFexception. In contrast, the byUTF conversions return a replacementDchar instead, as does foreach() when decoding.

This enhancement would make the behavior consistent, with the additional benefits of character processing being @nogc and nothrow and even pure.

--