Create a gist now

Instantly share code, notes, and snippets.

Rust DLL Unicode conversion test
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace RustLibSample {
static class NativeMethods {
[DllImport("foo.dll", EntryPoint = "hello2", CharSet=CharSet.Unicode)]
public static extern void Hello2(string a);
}
class Program {
static void Main(string[] args) {
NativeMethods.Hello2("日本ABC");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment