The trick was replacing control->LoadFile with the new EncodingDetector class.
Here's the relevant code in editormanager.cpp: (from line 2199 approx.)
// check if the file is already opened in built-in editor and do search in it
cbEditor* ed = IsBuiltinOpen(filesList[i]);
if (ed)
control->SetText(ed->GetControl()->GetText());
else {
EncodingDetector detector(filesList[i]);
if(!detector.IsOK()) {
continue;
}
control->SetText(detector.GetWxStr());
}
Note that editormanager.cpp needs the following line around the beginning:
#include "encodingdetector.h"
With this little modification, everything works!!! :D