From 928d6dde73b7efe639af9b327cee3f6ad8d39cff Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Tue, 30 Sep 2025 11:44:07 -0700 Subject: [PATCH] Change string marshalling to LPUTF8Str Updated the P/Invoke method signature to use LPUTF8Str for UTF-8 string marshalling. Fixes #48785 --- docs/standard/native-interop/type-marshalling.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/standard/native-interop/type-marshalling.md b/docs/standard/native-interop/type-marshalling.md index f05e60ffac31c..963ba826b44de 100644 --- a/docs/standard/native-interop/type-marshalling.md +++ b/docs/standard/native-interop/type-marshalling.md @@ -12,7 +12,7 @@ Marshalling is needed because the types in the managed and unmanaged code are di ```csharp [LibraryImport("somenativelibrary.dll")] -static extern int MethodA([MarshalAs(UnmanagedType.LPStr)] string parameter); +static extern int MethodA([MarshalAs(UnmanagedType.LPUTF8Str)] string parameter); // or