From f1e69d5bcf8f9fe9a0d70a803e5250284f68e3c8 Mon Sep 17 00:00:00 2001 From: Jehan Date: Mon, 22 Mar 2021 18:15:34 +0100 Subject: [PATCH] src: do not test with nsLatin1Prober anymore. Just commenting it out for now. This is just not good enough and could take over detection when other probers have low confidence (yet reasonable ones), returning an ugly WINDOWS-1252 with no language detection. I think we should even just get rid of it completely. For now, I temporarily uncomment it and will see with further experiments. --- src/nsUniversalDetector.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/nsUniversalDetector.cpp b/src/nsUniversalDetector.cpp index b143d9f..ea9a4d6 100644 --- a/src/nsUniversalDetector.cpp +++ b/src/nsUniversalDetector.cpp @@ -205,12 +205,19 @@ nsresult nsUniversalDetector::HandleData(const char* aBuf, PRUint32 aLen) if (nsnull == mCharSetProbers[1]) return NS_ERROR_OUT_OF_MEMORY; } - if (nsnull == mCharSetProbers[2]) + /* Disabling the generic WINDOWS-1252 (Latin 1) prober for now. + * We now have specific per-language models which are much more + * efficients and useful. This is where we should direct our + * efforts. Probably the whole nsLatin1Prober should disappear + * at some point, but let's keep it for now, in case this was an + * error. + */ + /* if (nsnull == mCharSetProbers[2]) { mCharSetProbers[2] = new nsLatin1Prober; if (nsnull == mCharSetProbers[2]) return NS_ERROR_OUT_OF_MEMORY; - } + }*/ } } else