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

nanoc does not detect UTF-8 encoding with lowercase 'utf' in LANG variable #335

Closed
mdekstrand opened this issue Sep 17, 2013 · 6 comments
Closed

Comments

@mdekstrand
Copy link

The check in the CLI for a UTF-8 locale is case-sensitive. Fedora uses en_US.utf8 as the environment variable for UTF-8 locales; this causes nanoc to fail with unicode errors.

@denisdefreyne
Copy link
Member

Good catch! I’ll fix.

@denisdefreyne
Copy link
Member

@elehack See PR #338 (if you want to review that code, you’re quite welcome—leave a :+1: when satisfied)

@denisdefreyne
Copy link
Member

@elehack You mentioned “unicode errors” — can you a bit more specific about that? There should not be any errors, even when UTF-8 support is not found.

@mdekstrand
Copy link
Author

I don't remember the exact error, and am having difficulty reproducing right now. It seemed to be a problem with filtering out the '…' characters (it complained that a string did not have valid multibyte characters, in the CLI output sanitization stack).

@mdekstrand
Copy link
Author

Just encountered the error again, so I can provide a stack dump :). nanoc 3.6.5 on JRuby:

Captain! We've been hit!

Message:

RegexpError: invalid multibyte character: /�/

Compilation stack:

  (empty)

Stack trace:

  0. org/jruby/RubyString.java:3099:in `gsub'
  1. org/jruby/RubyString.java:3067:in `gsub'
  2. /home/michael/Research/LensKit/website/gems/jruby/1.9/gems/nanoc-3.6.5/lib/nanoc/cli/stream_cleaners/utf8.rb:11:in `clean'
  3. /home/michael/Research/LensKit/website/gems/jruby/1.9/gems/nanoc-3.6.5/lib/nanoc/cli/cleaning_stream.rb:115:in `clean'
  4. org/jruby/RubyArray.java:1617:in `each'
  5. org/jruby/RubyEnumerable.java:815:in `inject'
  6. /home/michael/Research/LensKit/website/gems/jruby/1.9/gems/nanoc-3.6.5/lib/nanoc/cli/cleaning_stream.rb:115:in `clean'
  7. /home/michael/Research/LensKit/website/gems/jruby/1.9/gems/nanoc-3.6.5/lib/nanoc/cli/cleaning_stream.rb:44:in `write'
  8. org/jruby/RubyKernel.java:1361:in `warn'
  9. file:/home/michael/Research/LensKit/website/jruby-1.7.4/lib/jruby.jar!/jruby/kernel/signal.rb:27:in `trap'
  ... 15 more lines omitted. See full crash log for details.

If you believe this is a bug in nanoc, please do report it at
-> https://github.com/nanoc/nanoc/issues/new <-

A detailed crash log has been written to ./crash.log.

Running with LANG=en_US.UTF-8 makes it go away.

@denisdefreyne
Copy link
Member

I’ve added this as issue #340!

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

2 participants