You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.
If file path is passed to json that is encoded as UTF-8-BOM to method
GATEWAY_HANDLE Gateway_CreateFromJson(const char* file_path)
no gateway is created (LogError("Input file [%s] could not be read.", file_path);).
I did this test in from .NET code (because VS by default adds BOM)
and I consume those method from c#:
[DllImport(@"dotnet.dll", EntryPoint = "Module_Gateway_CreateFromJson", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr GatewayCreateFromJson([MarshalAs(UnmanagedType.LPStr)] string filePath);
Hi @AdamMachera, this is actually due to an issue with one of our dependencies that we use to read JSON configs. I've opened an issue with there that you can see here.
Parson was updated to read files with UTF-8 BOM. The gateway updated it's submodule reference to parson (98f8aae). So this issue should be fixed in the latest code on the develop branch.
If file path is passed to json that is encoded as UTF-8-BOM to method
GATEWAY_HANDLE Gateway_CreateFromJson(const char* file_path)
no gateway is created (LogError("Input file [%s] could not be read.", file_path);).
I did this test in from .NET code (because VS by default adds BOM)
To make it happen I extended dotnet.cpp
MODULE_EXPORT GATEWAY_HANDLE Module_Gateway_CreateFromJson(const char* file_path)
{
return Gateway_CreateFromJson(file_path);
}
MODULE_EXPORT void Module_Gateway_Destroy(GATEWAY_HANDLE handle)
{
Gateway_Destroy(handle);
}
and I consume those method from c#:
[DllImport(@"dotnet.dll", EntryPoint = "Module_Gateway_CreateFromJson", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr GatewayCreateFromJson([MarshalAs(UnmanagedType.LPStr)] string filePath);
The text was updated successfully, but these errors were encountered: