[Github-comments] [geany/geany] In the Compiler window: UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 1: ordinal not in range(128) (#1732)

Ludovic Rousseau notifications at xxxxx
Wed Jan 3 17:52:10 UTC 2018


I use macOS High Sierra (10.13.2) and Geany 1.32.
I have configured Geany to use the French l10n by creating an empty file ``~/.config/geany/use_locale``.
The Geany interface is now in French. Great.

My problem is that in Geany LANG is defined as "fr" and LC_ALL is defined as "" (nothing). I can see that by executing in the Geany Terminal window:
```
[rousseau:~] $ echo $LANG
fr
[rousseau:~] $ echo $LC_ALL

```

I have configured the lint menu to do: ``pep8 --max-line-length=80 "%f"`` and in the Compilateur window I get:
```
pep8 --max-line-length=80 "dé.py" (dans le dossier : /Users/rousseau/Documents/Sources/Python)
Traceback (most recent call last):
  File "/usr/local/bin/pep8", line 11, in <module>
    sys.exit(_main())
  File "/usr/local/lib/python3.6/site-packages/pep8.py", line 2134, in _main
    report = pep8style.check_files()
  File "/usr/local/lib/python3.6/site-packages/pep8.py", line 1842, in check_files
    runner(path)
  File "/usr/local/lib/python3.6/site-packages/pep8.py", line 1854, in input_file
    return fchecker.check_all(expected=expected, line_offset=line_offset)
  File "/usr/local/lib/python3.6/site-packages/pep8.py", line 1619, in check_all
    return self.report.get_file_results()
  File "/usr/local/lib/python3.6/site-packages/pep8.py", line 1750, in get_file_results
    'code': code, 'text': text,
UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 1: ordinal not in range(128)
Compilation échouée.
```

If I hack ``/Applications/Geany.app/Contents/MacOS/geany`` to add the line:
```
LC_ALL=fr_FR.UTF-8
```
Then Geany works correctly and I get the expected output:
```
pep8 --max-line-length=80 "dé.py" (dans le dossier : /Users/rousseau/Documents/Sources/Python)
dé.py:30:1: E302 expected 2 blank lines, found 0
Compilation échouée.
```
The problem is caused by the accent in the source code file: ``dé.py``. If I rename the file to ``de.py`` then I do not have the problem.

I can also define LANG=fr_FR.UTF-8 instead of LC_ALL for the same result.

What is important is to add the ".UTF-8" extension.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/1732
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20180103/3b92256a/attachment-0001.html>


More information about the Github-comments mailing list