コミュニティ

Porblem with french Langage 回答済み

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

この記事は役に立ちましたか?

0人中0人がこの記事が役に立ったと言っています

コメント

2件のコメント

  • Avatar
    Permanently deleted user

    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

    0
  • Avatar
    Permanently deleted user

    Thanks for your reply.

    In fact, i solved the probelem by adding

     

     

    #include <locale>

    int main (){

     

      setlocale(LC_ALL, "");

    ....

     

    }

    1

サインインしてコメントを残してください。