aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rdoc/encoding.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rdoc/encoding.rb')
-rw-r--r--lib/rdoc/encoding.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/rdoc/encoding.rb b/lib/rdoc/encoding.rb
index 9fe3539412..b3515a435f 100644
--- a/lib/rdoc/encoding.rb
+++ b/lib/rdoc/encoding.rb
@@ -29,7 +29,9 @@ module RDoc::Encoding
encoding ||= Encoding.default_external
orig_encoding = content.encoding
- if utf8 then
+ if not orig_encoding.ascii_compatible? then
+ content.encode! encoding
+ elsif utf8 then
content.force_encoding Encoding::UTF_8
content.encode! encoding
else