MCPcopy Create free account
hub / github.com/TypesettingTools/Aegisub / GetEncoding

Function GetEncoding

src/charset_detect.cpp:43–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41namespace CharSetDetect {
42
43std::string GetEncoding(agi::fs::path const& filename) {
44 auto encoding = agi::charset::Detect(filename);
45 if (!encoding.empty())
46 return encoding;
47
48 auto choices = agi::charset::GetEncodingsList<wxArrayString>();
49 int choice = wxGetSingleChoiceIndex(
50 _("Aegisub could not narrow down the character set to a single one.\nPlease pick one below:"),
51 _("Choose character set"),
52 choices);
53 if (choice == -1) throw agi::UserCancelException("Cancelled encoding selection");
54 return from_wx(choices[choice]);
55}
56
57}

Callers 2

OnCurrentImportMethod · 0.85
DoLoadSubtitlesMethod · 0.85

Calls 2

DetectFunction · 0.85
from_wxFunction · 0.85

Tested by

no test coverage detected