SublimeText / PhpBeautifier

Pear Php_beautifier plugin for Sublime Text 2
66 stars 17 forks source link

UnicodeEncodeError: 'ascii' codec can't encode character #3

Closed lioshi closed 12 years ago

lioshi commented 12 years ago

The file is in UTF-8, Unix. When execute ctrl+alt+f the console shows:

Traceback (most recent call last):
  File "./sublime_plugin.py", line 351, in run_
  File "./php_beautifier.py", line 16, in run
  File ".\subprocess.py", line 701, in communicate
  File ".\subprocess.py", line 1210, in _communicate
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 126: ordinal not in range(128)

If file's content has no accents in all works great. An idea?

gambledor commented 12 years ago

I've got something similar

Traceback (most recent call last): File "./sublimeplugin.py", line 351, in run File "./php_beautifier.py", line 16, in run File ".\subprocess.py", line 701, in communicate File ".\subprocess.py", line 1210, in _communicate UnicodeEncodeError: 'ascii' codec can't encode character u'\xf9' in position 368: ordinal not in range(128)

Plugin "version": "2012.01.16.08.08.00"

BarbUk commented 12 years ago

I just push a fix to prevent encoding problem. It works for me (with utf-8 or iso-8859-1). Can you test it on your system ?

lioshi commented 12 years ago

It works on my Fedora 16 64bits with utf8 and iso. Thanks.

gambledor commented 12 years ago

Now it works THX