Porblem with french Langage

  • 8 Views
  • Last Post 3 weeks ago
  • Topic Is Solved
Krayni Anis posted this 4 weeks ago

Dear support,

I have a problem when i try to use french langage. In fact,letters with accents are undetected and are replaced by question marks ?.

please find attached my example of code

CheckResult(recParams->SetPredefinedTextLanguage(CBstr(L"French")));

.....

 

FILE* f = fopen( fileName , "w+, ccs=UTF-8");

  CheckResult(pars->Item(p, &par ));
                BSTR parText;
                CheckResult(par->get_Text(&parText ));

                fwprintf(f,L"%S\n", parText);// to save result in text file

Order By: Standard | Newest | Votes
Koen de Leijer posted this 4 weeks ago

Hi

Three questions
- is French included in your ABBYY Finereader license?
- did you notice any errors in log/console/etc. ?
- can you provide a little more of your code?

This should do the trick;

CSafePtr<IRecognizerParams> recParams;
CheckResult(textBlock->get_RecognizerParams(&recParams));
CheckResult(recParams->put_OneLinePerBlock(VARIANT_TRUE));
CheckResult(recParams->put_OneWordPerLine(VARIANT_FALSE));
CheckResult(recParams->SetPredefinedTextLanguage(CBstr(L"French")));
CheckResult(recParams->put_TextTypes( TT_Normal ) );

Here is a working sample;
https://forum.ocrsdk.com/thread/extracting-known-blocks-with-minimum-preprocessing/

Best regards
Koen de Leijer

Krayni Anis posted this 3 weeks ago

Thanks for your reply.

In fact, i solved the probelem by adding

 

 

#include <locale>

int main (){

 

  setlocale(LC_ALL, "");

....

 

}

  • Liked by
  • Koen de Leijer
Close