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

invalid byte sequence #141

Closed
scarver2 opened this issue Apr 1, 2015 · 4 comments
Closed

invalid byte sequence #141

scarver2 opened this issue Apr 1, 2015 · 4 comments
Milestone

Comments

@scarver2
Copy link

scarver2 commented Apr 1, 2015

I'm encountering issues running I18n-tasks. My online research has not uncovered any solutions.

Here are my output logs.
https://gist.github.com/scarver2/f136b23f4b34606f18a1

@lenart
Copy link

lenart commented Apr 2, 2015

I had the same problem just now. Because I needed a quick solution I opened a file causing the error ~/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/i18n-tasks-0.8.0/lib/i18n/tasks/scanners/pattern_scanner.rb. I first output the paths to see which file blows up the scanning. In my case it was an otf font in app/assets/fonts/ so I edited the scan_file method to skip files in my app/assets.

    def scan_file(path, opts = {})
      return [] if path.match /app\/assets\//
      # ... rest of the code omitted
   end

This is not a solution but at the moment I cannot dig deeper. Hope it helps.

@glebm
Copy link
Owner

glebm commented Apr 2, 2015

I will release a new version with .otf excluded by default and a better error message.

@glebm glebm added this to the v0.8.1 milestone Apr 2, 2015
glebm added a commit that referenced this issue Apr 2, 2015
* The default config file now excludes `app/assets/images` and
  `app/assets/fonts`. Add `*.otf` to ignored extensions.

* If an error message occurs when scanning, the error message now
  includes the filename: #141
@glebm
Copy link
Owner

glebm commented Apr 2, 2015

Should be fixed in v0.8.1, please update and set search.exclude to:

search:
  exclude:
    - app/assets/images
    - app/assets/fonts

@scarver2
Copy link
Author

scarver2 commented Apr 5, 2015

Thank you. Ultimately, I discovered it was a SWF file in my assets that was throwing the exception. Adding the search exclusions to the YAML file resolved this.

@scarver2 scarver2 closed this as completed Apr 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants