Bug #1948
RDoc Fails with Non-ASCII Pathnames
| Status: | Closed | Start date: | 08/18/2009 | |
|---|---|---|---|---|
| Priority: | Low | Due date: | ||
| Assignee: | % Done: | 0% |
||
| Category: | lib | |||
| Target version: | 1.9.2 | |||
| ruby -v: | ruby 1.9.2dev (2009-08-05 trunk 24397) [i686-linux] |
Description
`rdoc` fails when the pathname is non-ASCII. This happens with or without the 'charset' option set to UTF-8. For example:
$ cat möbius.rb
# coding: utf-8
class Integer
def mobius
case
when (self < 1) then nil
when (square_free? and ω.even?) then 1
when (square_free? and ω.odd?) then -1
when (not square_free?) then 0
end
end
alias :möbius :mobius
alias :μ :mobius
end
$ rdoc möbius.rb
möbius.rb: Cm
Generating HTML...
(erb):45:in `concat': incompatible character encodings: UTF-8 and US-ASCII (Encoding::CompatibilityError)
from (erb):45:in `write_html_on'
from /usr/local/lib/ruby/1.9.1/erb.rb:753:in `eval'
from /usr/local/lib/ruby/1.9.1/erb.rb:753:in `result'
from /usr/local/lib/ruby/1.9.1/rdoc/template.rb:57:in `block in write_html_on'
from /usr/local/lib/ruby/1.9.1/rdoc/template.rb:56:in `reverse_each'
from /usr/local/lib/ruby/1.9.1/rdoc/template.rb:56:in `write_html_on'
from /usr/local/lib/ruby/1.9.1/rdoc/generator.rb:787:in `write_on'
from /usr/local/lib/ruby/1.9.1/rdoc/generator/html.rb:232:in `block (2 levels) in gen_into'
from /usr/local/lib/ruby/1.9.1/rdoc/generator/html.rb:231:in `open'
from /usr/local/lib/ruby/1.9.1/rdoc/generator/html.rb:231:in `block in gen_into'
from /usr/local/lib/ruby/1.9.1/rdoc/generator/html.rb:216:in `each'
from /usr/local/lib/ruby/1.9.1/rdoc/generator/html.rb:216:in `gen_into'
from /usr/local/lib/ruby/1.9.1/rdoc/generator/html.rb:179:in `generate_html'
from /usr/local/lib/ruby/1.9.1/rdoc/generator/html.rb:86:in `generate'
from /usr/local/lib/ruby/1.9.1/rdoc/rdoc.rb:279:in `document'
from /usr/local/bin/rdoc:15:in `<main>'
(I'm not sure whether to file RDoc bugs on the RubyForge tracker or here w.r.t 1.9. Apologies if I guessed wrongly.)
Related issues
History
Updated by drbrain (Eric Hodel) almost 3 years ago
- Assignee set to drbrain (Eric Hodel)
I prefer the RubyForge tracker, but I look here too :)
Updated by yugui (Yuki Sonoda) over 2 years ago
- Target version set to 1.9.2
Updated by drbrain (Eric Hodel) about 2 years ago
I have fixed this in rdoc trunk
Updated by drbrain (Eric Hodel) about 2 years ago
UTF-8 method names are checked in, but I did not test UTF-8 file name. I still need to test that part.
Updated by drbrain (Eric Hodel) about 2 years ago
- Status changed from Open to Closed
UTF-8 file names appear to work correctly too.