Make the logging for charset detection more useful by print the detected character set(s)

Originally committed to SVN as r4625.
This commit is contained in:
Amar Takhar 2010-06-27 20:03:38 +00:00
parent af5d34590a
commit 743997b266
1 changed files with 5 additions and 1 deletions

View File

@ -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;
}