Message Boards Message Boards

GROUPS:

Importing some text with apostrophes

Posted 10 months ago
1597 Views
|
3 Replies
|
2 Total Likes
|

Hello!

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,

Claude

3 Replies
Posted 10 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.

Posted 10 months ago

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
Attachments
Remove
or Discard

Group Abstract Group Abstract