Skip to content

Results window does not suport UTF-8? #30

Open

Description

@LudovicRousseau

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.

Activity

  1. LudovicRousseau commented on Dec 28, 2017

    @LudovicRousseau
    Author

    The problem may be related to #20

  2. LudovicRousseau commented on Dec 28, 2017

    @LudovicRousseau
    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.

  3. LudovicRousseau commented on Dec 28, 2017

    @LudovicRousseau
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions