Welcome to WCharT.NetStandard (a legacy cross platform package to interop with WCharT data.
To work with WCharT data create a new instance of WCharTString:
//Read data from a byte*
byte* pointer = NativeCall();
var str = new WCharTString(pointer).GetString();
//Create a buffer for a native library and read the data after it was filled
ReadOnlySpan<byte> data = new WCharTString(int bufferCharSize);
NativeCall(...);
var str = data.GetString();
//Pass a string to a native library
ReadOnlySpan<byte> data = new WCharTString(string str);
NativeCall(data);
//Can be used in fixed statements
var data = new WCharTString(string str);
fixed (byte* ptr = data)
{
NativeCall(ptr);
}To build the solution locally execute the following commands:
$ git clone https://github.com/jmoyola/WCharT.NetStandard
$ cd WCharT.NetStandard/src
$ dotnet fsi build.fsxHidApi.NetStandard is licensed under the terms of the MIT-License. Please see the license file for further information.
Original code programming fork: https://github.com/badcel/WCharT.Net