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

Set default Encoding to UTF_8 for Ruby 1.9 #244

Merged
merged 1 commit into from May 7, 2012
Merged

Set default Encoding to UTF_8 for Ruby 1.9 #244

merged 1 commit into from May 7, 2012

Conversation

darthdeus
Copy link
Contributor

Running rake convert_bundles on Ruby 1.9 will cause invalid byte sequence in US-ASCII exception.

Converting from extras/bundles/html-tmbundle
./extras/textmate_import.rb -d extras/bundles/html-tmbundle -o ./extras/imported/html-mode -q
./extras/textmate_import.rb:362:in `split': invalid byte sequence in US-ASCII (ArgumentError)
from ./extras/textmate_import.rb:362:in `block in <main>'
from ./extras/textmate_import.rb:360:in `open'
from ./extras/textmate_import.rb:360:in `<main>'
rake aborted!
Command failed with status (1): [./extras/textmate_import.rb -d extras/bund...]

This is because Ruby 1.9 isn't reading files in UTF-8 by default and is dependent on system locale. Setting Encoding.default_external = Encoding::UTF_8 fixes the issue.

joaotavora added a commit that referenced this pull request May 7, 2012
Set default Encoding to UTF_8 for Ruby 1.9
@joaotavora joaotavora merged commit bbef037 into joaotavora:master May 7, 2012
@joaotavora
Copy link
Owner

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants