   /// all current case mappings. In the event more space is needed, it will be
   /// allocated on the heap.
   internal func _applyMapping(_ u_strTo: _U_StrToX) -> String {
+    let utf16Length = UnicodeScalar(UInt32(_value))!.utf16.count
+    var utf16 = _utf16CodeUnits
     var scratchBuffer = _Normalization._SegmentOutputBuffer(allZeros: ())
     let count = scratchBuffer.withUnsafeMutableBufferPointer { bufPtr -> Int in
-      var utf16 = _utf16
       return withUnsafePointer(to: &utf16.0) { utf16Pointer in
         var err = __swift_stdlib_U_ZERO_ERROR
         let correctSize = u_strTo(
           bufPtr.baseAddress._unsafelyUnwrappedUnchecked,
           Int32(bufPtr.count),
           utf16Pointer,
-          Int32(_utf16Length),
+          Int32(utf16Length),
           "",
           &err)
         guard err.isSuccess ||


extension Unicode.Scalar.Properties {

  // The type of ICU case conversion functions.
  internal typealias _U_StrToX = (
    /* dest */ UnsafeMutablePointer<__swift_stdlib_UChar>,

    }
    var array = Array<UInt16>(repeating: 0, count: count)
    array.withUnsafeMutableBufferPointer { bufPtr in
      withUnsafePointer(to: &utf16.0) { utf16Pointer in
        var err = __swift_stdlib_U_ZERO_ERROR
        let correctSize = u_strTo(
          bufPtr.baseAddress._unsafelyUnwrappedUnchecked,
          Int32(bufPtr.count),
          utf16Pointer,
          Int32(utf16Length),
          "",
          &err)
        guard err.isSuccess else {
