[native] Fixed UTF8 encoding when using P/Invoke on Windows.