Bug #1948
closedRDoc Fails with Non-ASCII Pathnames
Description
=begin
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 `'
(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.)
=end
Updated by drbrain (Eric Hodel) about 15 years ago
- Assignee set to drbrain (Eric Hodel)
=begin
I prefer the RubyForge tracker, but I look here too :)
=end
Updated by drbrain (Eric Hodel) over 14 years ago
=begin
I have fixed this in rdoc trunk
=end
Updated by drbrain (Eric Hodel) over 14 years ago
=begin
UTF-8 method names are checked in, but I did not test UTF-8 file name.
I still need to test that part.
=end
Updated by drbrain (Eric Hodel) over 14 years ago
- Status changed from Open to Closed
=begin
UTF-8 file names appear to work correctly too.
=end