From 743997b26634dd152c8e127eb26d059d42b70874 Mon Sep 17 00:00:00 2001 From: Amar Takhar Date: Sun, 27 Jun 2010 20:03:38 +0000 Subject: [PATCH] Make the logging for charset detection more useful by print the detected character set(s) Originally committed to SVN as r4625. --- aegisub/src/charset_detect.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/aegisub/src/charset_detect.cpp b/aegisub/src/charset_detect.cpp index 5b210d670..136a3f1b0 100644 --- a/aegisub/src/charset_detect.cpp +++ b/aegisub/src/charset_detect.cpp @@ -54,7 +54,6 @@ namespace CharSetDetect { wxString GetEncoding(wxString const& filename) { - LOG_I("charset/file") << filename; bool unknown = 0; agi::charset::CharsetListDetected list; @@ -72,16 +71,21 @@ wxString GetEncoding(wxString const& filename) { // Get choice from user wxArrayString choices; + std::string log_choice; for (i_lst = list.begin(); i_lst != list.end(); ++i_lst) { choices.Add(lagi_wxString(i_lst->second)); + log_choice.append(" " + i_lst->second); } + LOG_I("charset/file") << filename << " (" << log_choice << ")"; + int choice = wxGetSingleChoiceIndex(_("Aegisub could not narrow down the character set to a single one.\nPlease pick one below:"),_("Choose character set"),choices); if (choice == -1) throw _T("Canceled"); return choices.Item(choice); } i_lst = list.begin(); + LOG_I("charset/file") << filename << " (" << i_lst->second << ")"; return i_lst->second; }