Skip to content
Extraits de code Groupes Projets
Valider d50c3575 rédigé par Rodrigo Braz Monteiro's avatar Rodrigo Braz Monteiro
Parcourir les fichiers

Fixed crash on charset detection.

Originally committed to SVN as r1811.
parent ed29ba8f
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -69,15 +69,17 @@ wxString CharSetDetect::GetEncoding(wxString filename) { ...@@ -69,15 +69,17 @@ wxString CharSetDetect::GetEncoding(wxString filename) {
// Grab every result obtained // Grab every result obtained
std::list<CharDetResult> results; std::list<CharDetResult> results;
for (int i=0;i<NUM_OF_CHARSET_PROBERS;i++) { for (int i=0;i<NUM_OF_CHARSET_PROBERS;i++) {
int probes = mCharSetProbers[i]->GetProbeCount(); if (mCharSetProbers[i]) {
for (int j=0;j<probes;j++) { int probes = mCharSetProbers[i]->GetProbeCount();
float conf = mCharSetProbers[i]->GetConfidence(j); for (int j=0;j<probes;j++) {
float conf = mCharSetProbers[i]->GetConfidence(j);
// Only bother with those whose confidence is at least 1%
if (conf > 0.01f) { // Only bother with those whose confidence is at least 1%
results.push_back(CharDetResult()); if (conf > 0.01f) {
results.back().name = wxString(mCharSetProbers[i]->GetCharSetName(j),wxConvUTF8); results.push_back(CharDetResult());
results.back().confidence = mCharSetProbers[i]->GetConfidence(j); results.back().name = wxString(mCharSetProbers[i]->GetCharSetName(j),wxConvUTF8);
results.back().confidence = mCharSetProbers[i]->GetConfidence(j);
}
} }
} }
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter