   }
   
   public static func decodeOne(_ source: Encoding.EncodedScalar) -> UnicodeScalar {
-    let bits = source._storage
-    if _fastPath(source._bitCount == 16) {
-      return UnicodeScalar(_unchecked: bits & 0xffff)
-    }
-    _sanityCheck(source._bitCount == 32)
-    let value = 0x10000 + ((bits & 0x03ff0000) &>> 6 | (bits & 0x03ff))
-    return UnicodeScalar(_unchecked: value)
-  }  
+    return UTF16.ForwardDecoder.decodeOne(source)
+  }
+  
+  public func _bufferedScalar(bitCount: UInt8) -> Encoding.EncodedScalar {
+    return Encoding.EncodedScalar(
+      _storage:
+        (buffer._storage << 16 | buffer._storage >> 16) &>> (32 - bitCount),
+      _bitCount: bitCount
+    )
+  }
 }
 
 extension Unicode.UTF16.ForwardDecoder : _UTF16Decoder {

    }
    return 1
  }
}

extension Unicode.UTF8.ForwardDecoder : _UTF8Decoder {
  public typealias Encoding = Unicode.UTF8
  
  public static var replacement : Encoding.EncodedScalar {

    _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
