diff --git a/README.md b/README.md index bad4127..768111e 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,9 @@ OCR plugin for ksnip. -See ksnip README for install and usage instruction [here](https://github.com/ksnip/ksnip#plugins). \ No newline at end of file +See ksnip README for install and usage instruction [here](https://github.com/ksnip/ksnip#plugins). + + + +## About Fork +Fork created to address the issue of missing accents in the OCR output. \ No newline at end of file diff --git a/src/OcrWrapper.cpp b/src/OcrWrapper.cpp index 1b75f04..9d6cebd 100644 --- a/src/OcrWrapper.cpp +++ b/src/OcrWrapper.cpp @@ -41,7 +41,7 @@ QString OcrWrapper::recognize(const QPixmap &pixmap, const QString &dataPath) co QString OcrWrapper::recognizeInner(const QPixmap &pixmap, char * dataPath) const { - if (mTessApi->Init(dataPath, "eng") == 0) + if (mTessApi->Init(dataPath, "por") == 0) { auto pix = makePixFromPixmap(pixmap); mTessApi->SetImage(pix); @@ -50,9 +50,9 @@ QString OcrWrapper::recognizeInner(const QPixmap &pixmap, char * dataPath) const pixDestroy(&pix); - return QString::fromLatin1(recognizedText.data()); + return QString::fromUtf8(recognizedText.data()); - } else { + } else { qCritical("Failed to initialize Tesseract"); return {}; }