From 8d875a8e6898e55812dc1b58ffb219ba57910829 Mon Sep 17 00:00:00 2001 From: raymai97 Date: Mon, 25 Jan 2021 02:53:31 +0800 Subject: [PATCH] - Let "GetPrivateProfileString" use Unicode to prevent mojibake issue when specified "Language" is different from system locale (non-Unicode language) --- wumgr/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wumgr/Program.cs b/wumgr/Program.cs index e8617ac..f4cbf5a 100644 --- a/wumgr/Program.cs +++ b/wumgr/Program.cs @@ -263,7 +263,7 @@ public static void IniWriteValue(string Section, string Key, string Value, strin WritePrivateProfileString(Section, Key, Value, INIPath != null ? INIPath : GetINIPath()); } - [DllImport("kernel32")] + [DllImport("kernel32", CharSet = CharSet.Unicode)] private static extern int GetPrivateProfileString(string section, string key, string def, [In, Out] char[] retVal, int size, string filePath); public static string IniReadValue(string Section, string Key, string Default = "", string INIPath = null) {