Skip to content

Instantly share code, notes, and snippets.

@sunnyone
Created June 12, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sunnyone/1d9e081df7eada21911d to your computer and use it in GitHub Desktop.
Save sunnyone/1d9e081df7eada21911d to your computer and use it in GitHub Desktop.
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