Skip to content

Commit

Permalink
Replace with an easier to use API
Browse files Browse the repository at this point in the history
  • Loading branch information
yuslepukhin committed Nov 29, 2023
1 parent e5fc5d4 commit 765d518
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion csharp/src/Microsoft.ML.OnnxRuntime/OrtValue.shared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public string GetStringElement(int index)

unsafe
{
return new string((sbyte*)bufferPtr.ToPointer(), 0, (int)bytesLen, Encoding.UTF8);
return Encoding.UTF8.GetString((byte*)bufferPtr.ToPointer(), (int)bytesLen);
}
}

Expand Down

0 comments on commit 765d518

Please sign in to comment.