     }
   }
 
+  @_specialize(where Encoding == Unicode.UTF8)
+  @_specialize(where Encoding == Unicode.UTF16)
+  @inlinable
+  @_alwaysEmitIntoClient
+  @available(*, deprecated, message: "Operate directly on the String")
+  public static func decodeCString<Encoding: _UnicodeEncoding>(
+    _ cString: String,
+    as encoding: Encoding.Type,
+    repairingInvalidCodeUnits isRepairing: Bool = true
+  ) -> (result: String, repairsMade: Bool)? {
+    return cString.withCString(encodedAs: encoding) {
+      String.decodeCString(
+        $0, as: encoding, repairingInvalidCodeUnits: isRepairing
+      )
+    }
+  }
+
   /// Creates a string from the null-terminated sequence of bytes at the given
   /// pointer.
   ///

    }) else { return nil }

    self = string
  }

  /// Creates a new string by copying the null-terminated data referenced by

  ) {
    self = String.decodeCString(nullTerminatedCodeUnits, as: sourceEncoding)!.0
  }

  @_specialize(where Encoding == Unicode.UTF8)
  @_specialize(where Encoding == Unicode.UTF16)
  @inlinable
  @_alwaysEmitIntoClient
  @available(*, deprecated, message: "Operate directly on the String")
  public init<Encoding: _UnicodeEncoding>(
    decodingCString nullTerminatedCodeUnits: String,
    as sourceEncoding: Encoding.Type
  ) {
    self = nullTerminatedCodeUnits.withCString(encodedAs: sourceEncoding) {
      String(decodingCString: $0, as: sourceEncoding.self)
    }
  }
}

extension UnsafePointer where Pointee == UInt8 {
