Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6725025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:45:30+00:00 2026-05-26T09:45:30+00:00

I have a French dictionary file which I got from WinEdt.org (Zip File) .

  • 0

I have a French dictionary file which I got from WinEdt.org (Zip File). I’d like to read this file into memory, but when I do I get the error:

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in
  position 69: ordinal not in range(128)

I’ve also tried using the codecs module with the encoding utf-8, but that doesn’t work either:

    with codecs.open(self.template_folder_path + "/" + self.test_language + ".txt",
                     'rb', encoding='utf-8') as fp:
        word_list = []

        for line in fp:
            word_list.append(line.strip())

        self.words[self.test_language] = word_list

How can I read this file? I also need to read in a few other dictionary files from that website. How do I go about that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:45:30+00:00Added an answer on May 26, 2026 at 9:45 am

    latin1 aka ISO-8859-1 is “a snare and a delusion”. Decoding random binary gibberish with latin1 “works”, because the latin1 codec maps all 256 bytes to a Unicode codepoint.

    In this case given the information (1) French (2) “WinEdt.org” (hello hello, that’s “Win” as in “Windows”). the file is likely to be encoded in cp1252.

    >>> guff = open('fr.dic', 'rb').read()
    >>> z = guff.decode('latin1')
    >>> sum((128 <= ord(c) < 160) for c in z) # count the C1 control characters
    141 
    >>> aliens = set(c for c in z if 128 <= ord(c) < 160)
    >>> aliens
    set([u'\x9c'])
    >>> from unicodedata import name
    >>> name(u'\x9c')
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ValueError: no such name
    >>> name('\x9c'.decode('cp1252'))
    'LATIN SMALL LIGATURE OE'
    
    QED
    

    Update: You asked about other files on that website. The first thing to do would be (as the site recommends) to read the .TXT file associated with the dictionary. For example, the large Russian dictionary’s .TXT file says “The dictionary assumes standard Windows Russian codepage (1251)”. Failing that, try the most appropriate from this list:

    cp1250 eastern European Latin-based scripts e.g. Polish, Czech, Serbian (Latin script)
    cp1251 Cyrillic-based scripts e.g. Russian, Ukrainian, Serbian (Cyrillic script)
    cp1252 western European Latin-based scripts e.g. German, French
    cp1253 Greek
    cp1254 Turkish
    cp1255 Hebrew
    cp1256 Arabic
    cp1257 Estonian, Latvian and Lithuanian
    cp1258 Vietnamese

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this text in a file - Recuérdame (notice it's a French word).
I have downloaded an excel file where specific french characters such as é appear
I have this enumeration: public enum Translation { English=1, Russian, French, German } I
have written this little class, which generates a UUID every time an object of
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
I have a java application which has a GUI in both English and French,
I am using French and English in my website. I have two links like
I need to download a file with french file name for example mé.txt..I have
I have a website which contains french, with accents é, è, à,.... The website
I have a value that comes out of this statement : #springMessage(count.french) That I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.