Message Boards Message Boards


Importing some text with apostrophes

Posted 5 months ago
3 Replies
2 Total Likes


I want to import a text in French, but unfortunately apostrohes disappear! Consider

LeTexte = Import["UEMO2021.txt", {"Text", "Lines"}]

While in the original document we have for instance the sentence "j’ai apprécié l’approche de l’origine des prénoms", I obtain in LeTexte : "j’ai apprécié l’approche de l’origine des prénoms".... What should I do? Thanks a lot in advance,


3 Replies
Posted 5 months ago

I think you'll succeed with Mike's suggestion above. But also be aware that different sources can use different characters for apostrophe. So one encoding might not work for all documents.

Thank you very much!

LeTexte = 
  Import["UEMO2021.txt", {"Text", "Lines"}, 
   CharacterEncoding -> "WindowsANSI"];

works perfectly!

Regards, Claude

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract