OSDN Git Service

Add support i18n.logOutputEncoding at log list
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / AppUtils.cpp
index 74acedb..c1c0f54 100644 (file)
@@ -1989,7 +1989,27 @@ bool CAppUtils::SendPatchMail(CTGitPathList &list,bool autoclose)
        }\r
        return false;\r
 }\r
+int CAppUtils::GetLogOutputEncode()\r
+{\r
+       CString cmd,output;\r
+       int start=0;\r
+       cmd=_T("git.exe config i18n.logOutputEncoding");\r
+       if(g_Git.Run(cmd,&output,CP_ACP))\r
+       {\r
+               cmd=_T("git.exe config i18n.commitencoding");\r
+               if(g_Git.Run(cmd,&output,CP_ACP))\r
+                       return CP_UTF8;\r
+       \r
+               int start=0;\r
+               output=output.Tokenize(_T("\n"),start);\r
+               return CUnicodeUtils::GetCPCode(output);        \r
 \r
+       }else\r
+       {\r
+               output=output.Tokenize(_T("\n"),start);\r
+               return CUnicodeUtils::GetCPCode(output);\r
+       }\r
+}\r
 int CAppUtils::SaveCommitUnicodeFile(CString &filename, CString &message)\r
 {\r
        CFile file(filename,CFile::modeReadWrite|CFile::modeCreate );\r