Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added encoding to open file #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Added encoding to open file #12

wants to merge 2 commits into from

Conversation

screendriver
Copy link
Contributor

On Windows machines your package can not be installed via pip, so I added utf-8 encoding:

File "C:\Users\me\AppData\Local\Temp\foo-packaging587492447920215615.tmp\microsofttranslator\setup.py", line 34, in read
    return open(os.path.join(os.path.dirname(__file__), fname)).read()
File "C:\Python34\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 1377: character maps to <undefined>

@screendriver
Copy link
Contributor Author

Hmm it seems that the keyword argument "encoding" is not supported in Python 2.7. Is there a workaround for that?

@sharoonthomas
Copy link
Contributor

@bbqrob
Copy link

bbqrob commented Aug 20, 2014

Successfully tested on Windows 8.1 with Python 3.4

@screendriver
Copy link
Contributor Author

Another solution where you don't have to change anything in your Python code: simple replace "Olá" with "Ola" 😉

@sharoonthomas
Copy link
Contributor

@screendriver wouldn't that be ironic given what we are all trying to do is translate between languages :)

@screendriver
Copy link
Contributor Author

That's true. But look at @rob19780114 s post. It seems to work with the codec Python module.

@bbqrob
Copy link

bbqrob commented Aug 20, 2014

@sharoonthomas Actually it's not a problem supplying à, but please set the correct encoding, if you do so. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants