forked from mia/Aegisub
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:
parent
af5d34590a
commit
743997b266
1 changed files with 5 additions and 1 deletions
|
@ -54,7 +54,6 @@
|
||||||
namespace CharSetDetect {
|
namespace CharSetDetect {
|
||||||
|
|
||||||
wxString GetEncoding(wxString const& filename) {
|
wxString GetEncoding(wxString const& filename) {
|
||||||
LOG_I("charset/file") << filename;
|
|
||||||
bool unknown = 0;
|
bool unknown = 0;
|
||||||
|
|
||||||
agi::charset::CharsetListDetected list;
|
agi::charset::CharsetListDetected list;
|
||||||
|
@ -72,16 +71,21 @@ wxString GetEncoding(wxString const& filename) {
|
||||||
// Get choice from user
|
// Get choice from user
|
||||||
wxArrayString choices;
|
wxArrayString choices;
|
||||||
|
|
||||||
|
std::string log_choice;
|
||||||
for (i_lst = list.begin(); i_lst != list.end(); ++i_lst) {
|
for (i_lst = list.begin(); i_lst != list.end(); ++i_lst) {
|
||||||
choices.Add(lagi_wxString(i_lst->second));
|
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);
|
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");
|
if (choice == -1) throw _T("Canceled");
|
||||||
return choices.Item(choice);
|
return choices.Item(choice);
|
||||||
}
|
}
|
||||||
|
|
||||||
i_lst = list.begin();
|
i_lst = list.begin();
|
||||||
|
LOG_I("charset/file") << filename << " (" << i_lst->second << ")";
|
||||||
return i_lst->second;
|
return i_lst->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue