   }
   
   public static func decodeOne(_ source: Encoding.EncodedScalar) -> UnicodeScalar {
-    let bits = source._storage
-    switch source._bitCount {
-    case 8: return UnicodeScalar(_unchecked: bits)
-    case 16:
-      var value = bits       & 0b0______________________11_1111
-      value    |= bits &>> 2 & 0b0______________0111__1100_0000
-      return UnicodeScalar(_unchecked: value)
-    case 24:
-      var value = bits       & 0b0______________________11_1111
-      value    |= bits &>> 2 & 0b0______________1111__1100_0000
-      value    |= bits &>> 4 & 0b0_________1111_0000__0000_0000
-      return UnicodeScalar(_unchecked: value)
-    default:
-      _sanityCheck(source._bitCount == 32)
-      var value = bits       & 0b0______________________11_1111
-      value    |= bits &>> 2 & 0b0______________1111__1100_0000
-      value    |= bits &>> 4 & 0b0_____11__1111_0000__0000_0000
-      value    |= bits &>> 6 & 0b0_1_1100__0000_0000__0000_0000
-      return UnicodeScalar(_unchecked: value)
-    }
-  }
-  
+    return UTF8.ForwardDecoder.decodeOne(source)
+  }
+
   public // @testable
   func _parseMultipleCodeUnits() -> (isValid: Bool, bitCount: UInt8) {
     _sanityCheck(buffer._storage & 0x80 != 0) // this case handled elsewhere

  static func _isScalar(_: Encoding.CodeUnit) -> Bool
  func _parseMultipleCodeUnits() -> (isValid: Bool, bitCount: UInt8)
  var buffer: Encoding.EncodedScalar { get set }
}

extension _UTFDecoder where Encoding.EncodedScalar == _UIntBuffer<UInt32, Encoding.CodeUnit> {

    _sanityCheck(scalarBitCount <= buffer._bitCount)
    
    // Consume the decoded bytes (or maximal subpart of ill-formed sequence).
    let encodedScalar = _bufferedScalar(bitCount: scalarBitCount)
    
    buffer._storage = UInt32(
      // widen to 64 bits so that we can empty the buffer in the 4-byte case
