+}\r
+\r
+int CAppUtils::SaveCommitUnicodeFile(CString &filename, CString &message)\r
+{\r
+ CFile file(filename,CFile::modeReadWrite|CFile::modeCreate );\r
+ CString cmd,output;\r
+ int cp=CP_UTF8;\r
+\r
+ cmd=_T("git.exe config i18n.commitencoding");\r
+ if(g_Git.Run(cmd,&output,CP_ACP))\r
+ cp=CP_UTF8;\r
+ \r
+ int start=0;\r
+ output=output.Tokenize(_T("\n"),start);\r
+ cp=CUnicodeUtils::GetCPCode(output); \r
+\r
+ int len=message.GetLength();\r
+\r
+ char * buf;\r
+ buf = new char[len*4 + 4];\r
+ SecureZeroMemory(buf, (len*4 + 4));\r
+\r
+ int lengthIncTerminator = WideCharToMultiByte(cp, 0, message, -1, buf, len*4, NULL, NULL);\r
+\r
+ file.Write(buf,lengthIncTerminator-1);\r
+ file.Close();\r
+ delete buf;\r
+ return 0;\r