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

Results window does not suport UTF-8? #30

Open
LudovicRousseau opened this issue Dec 28, 2017 · 3 comments
Open

Results window does not suport UTF-8? #30

LudovicRousseau opened this issue Dec 28, 2017 · 3 comments

Comments

@LudovicRousseau
Copy link

I use Python3 as configured in #1 (comment)

My program is:

#! /usr/bin/env python3

import sys
print(sys.version)

# comment with accent: voici voilà

print("voici voilà")

On the macOS Terminal console the output is:

$ python3 utf8.py 
3.6.3 (default, Oct  4 2017, 06:09:15) 
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)]
voici voilà

In Brackets "Run Results" window I get the error:

, in
     print("voici voil\xe0")
UnicodeEncoreError: 'ascii' codec can't encode character '\xe0' in position 10: ordinal not in range(128)

Note that \xe0 is the ISO-8859-1 encoding for "à". The UTF-8 encoding is \xc3\xa0.
My source code file is encoded using UTF-8.

I have no idea what/who is converting from UTF-8 to ISO-8859-1.

@LudovicRousseau
Copy link
Author

The problem may be related to #20

@LudovicRousseau
Copy link
Author

If I start Brackets from the Terminal application using open /Applications/Brackets.app I do not have the problem.
The difference is that when started from Terminal the environment variable LANG is set to fr_FR.UTF-8.

One solution to my problem is to created a wrapper application:

$ find /Applications/Brackets-unicode.app
/Applications/Brackets-unicode.app
/Applications/Brackets-unicode.app/Contents
/Applications/Brackets-unicode.app/Contents/MacOS
/Applications/Brackets-unicode.app/Contents/MacOS/brackets.sh
/Applications/Brackets-unicode.app/Contents/Resources
/Applications/Brackets-unicode.app/Contents/Resources/appshell.icns
/Applications/Brackets-unicode.app/Contents/Info.plist

The script brackets.sh contains:

#!/bin/bash

export LANG=fr_FR.UTF-8
open - a Brackets.app

Maybe the same kind of trick could be used in Brackets.
This bugs should be for Brackets and not for the plugin.

@LudovicRousseau
Copy link
Author

I opened a bug at Brackets adobe/brackets#14002

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

No branches or pull requests

1 participant