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

Partial from Code not working #14

Open
tehPlayer opened this issue Oct 30, 2015 · 3 comments
Open

Partial from Code not working #14

tehPlayer opened this issue Oct 30, 2015 · 3 comments

Comments

@tehPlayer
Copy link

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 550, in run_
    return self.run(edit, **args)
  File "RailsPartial in /Users/marcinadamczyk/Library/Application Support/Sublime Text 3/Installed Packages/Rails Partial.sublime-package", line 36, in run
  File "RailsPartial in /Users/marcinadamczyk/Library/Application Support/Sublime Text 3/Installed Packages/Rails Partial.sublime-package", line 47, in get_selected_text
  File "RailsPartial in /Users/marcinadamczyk/Library/Application Support/Sublime Text 3/Installed Packages/Rails Partial.sublime-package", line 96, in create_partial_file
UnicodeEncodeError: 'ascii' codec can't encode character '\xa3' in position 981: ordinal not in range(128)

After selecting code, pressing ALT+P, typing in name of new partial, it creates a partial, but empty. It doesnt remove code from original file, just creates the file.

@wesf90
Copy link
Owner

wesf90 commented Nov 1, 2015

Thanks for bringing this to my attention!

What type of file are you using this in? Also, what is the code being selected? Anything out of the ordinary?

@tehPlayer
Copy link
Author

I found an error. If I select £ I get this error.

purchase less than £5,000

@feliperaul
Copy link

I have the same issue. If I select any accentuation chars (like Anúncios) it doesn't work (exact behavior as described by OP).

The error in the log is:
Traceback (most recent call last): File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 568, in run_ return self.run(edit, **args) File "RailsPartial in /Users/feliperaul/Library/Application Support/Sublime Text 3/Installed Packages/Rails Partial.sublime-package", line 36, in run File "RailsPartial in /Users/feliperaul/Library/Application Support/Sublime Text 3/Installed Packages/Rails Partial.sublime-package", line 47, in get_selected_text File "RailsPartial in /Users/feliperaul/Library/Application Support/Sublime Text 3/Installed Packages/Rails Partial.sublime-package", line 96, in create_partial_file UnicodeEncodeError: 'ascii' codec can't encode character '\xfa' in position 112: ordinal not in range(128)

If I select any other code it works fine.

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

3 participants