       _elements: codeUnits, _position: nextPosition
     )
     var d = Encoding.ForwardDecoder()
-    switch d.parseOne(&i) {
+    switch d.parseScalar(from: &i) {
     case .valid(let scalarContent):
       return Index(
         codeUnitIndex: nextPosition,

extension Unicode.DefaultScalarView : BidirectionalCollection {
  @inline(__always)
  public func index(before i: Index) -> Index {
    var d = Encoding.ReverseDecoder()
    
    var more = ReverseIndexingIterator(
      _elements: codeUnits, _position: i.codeUnitIndex)
    
    switch d.parseOne(&more) {
    case .valid(let scalarContent):
      let d: CodeUnits.IndexDistance = -numericCast(scalarContent.count)
      return Index(


extension Unicode {
  struct ParsingIterator<
    CodeUnitIterator : IteratorProtocol, 
    Decoder: UnicodeDecoder
  > where Decoder.Encoding.CodeUnit == CodeUnitIterator.Element {
    var codeUnits: CodeUnitIterator
    var decoder: Decoder
  }
}

extension Unicode.ParsingIterator : IteratorProtocol, Sequence {
  mutating func next() -> Decoder.Encoding.EncodedScalar? {
    switch decoder.parseScalar(from: &codeUnits) {
    case let .valid(scalarContent): return scalarContent
    case .invalid: return Decoder.Encoding.encodedReplacementCharacter
    case .emptyInput: return nil
