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

'charmap' codec can't encode character '\u0308' #42

Closed
GoogleCodeExporter opened this issue Aug 23, 2015 · 4 comments
Closed

'charmap' codec can't encode character '\u0308' #42

GoogleCodeExporter opened this issue Aug 23, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Run "python .\gitinspector.py --grading --format=html --file-types=java,xml 
path\to\repo" on a repository which contains files with ÅÄÖ (?).

What is the expected output? What do you see instead?
Expected output: 
HTML file

Actual output:
Beginning of HTML file, but then an error:

Traceback (most recent call last):
  File ".\gitinspector.py", line 202, in <module>
  File ".\gitinspector.py", line 194, in main
  File ".\gitinspector.py", line 88, in output
  File "D:\Drive\Jobb\ITHS\2014 Java\Projekt 1\Inlämningar\gitinspector-0.3.2\gitinspector\outputable.py", line 36, in output
    outputable.output_html()
  File "D:\Drive\Jobb\ITHS\2014 Java\Projekt 1\Inlämningar\gitinspector-0.3.2\gitinspector\changes.py", line 256, in output_html
    print(changes_xml)
  File "C:\Python33\lib\encodings\cp850.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u0308' in position 
403: character maps to <undefined>

What version of the product are you using? What version of Python? On what
operating system?
Gitinspector 0.3.2
I'm using Windows 8, PowerShell and Python 3.3.


Please provide any additional information below.
I'm using windows, and the files I'm analysing were created on a Mac. I'm 
pretty sure the files contains ÅÄÖ characters.
\u0308 seems to be the ¨ symbol or something similar.

Original issue reported on code.google.com by Niklas.L...@gmail.com on 4 Nov 2014 at 4:20

@GoogleCodeExporter
Copy link
Author

This simply means that you terminal is unable to accept the given character 
(\u0308). Meaning, the terminal encoding you are running (cp850) can't display 
the given character. Gitinspector will always try to convert the output to your 
encoding.

You have two options:
1. Change the encoding of your terminal to something that is able to cope with 
the 
   character.
2. Redirect the output to a file with ">". In this case Gitinspector should 
always try   
   to output pure UTF-8.

Original comment by gitinspe...@ejwa.se on 6 Nov 2014 at 9:59

  • Changed state: NeedsFeedback

@GoogleCodeExporter
Copy link
Author

Thanks for the answer! 
Unfortunately, the error persists even though I redirect the output to a file.

Command:
python .\gitinspector.py --grading --format=html --file-types=java,xml 
path\to\repo > test.html

Could it perhaps still be the fault of my terminal?

Original comment by Niklas.L...@gmail.com on 6 Nov 2014 at 7:14

@GoogleCodeExporter
Copy link
Author

The error does seem to indicate it... Try checking your PYTHONIOENCODING. Also, 
refer to issue 9 for some additional information.

Also, try the gitinspector version from the master branch to see if it makes 
any difference.

/Adam Waldenberg

Original comment by gitinspe...@ejwa.se on 12 Nov 2014 at 2:50

@GoogleCodeExporter
Copy link
Author

Seeing that I'm not getting any feedback on this one I'm assuming this issue as 
invalid; considering it's most likely a problem with the terminal.

/Adam Waldenberg

Original comment by gitinspe...@ejwa.se on 3 Dec 2014 at 11:37

  • Changed state: Invalid

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

No branches or pull requests

2 participants