diff options
Diffstat (limited to 'lib/rdoc')
-rw-r--r-- | lib/rdoc/parser.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rdoc/parser.rb b/lib/rdoc/parser.rb index 2f1b9cde8d..1dee485492 100644 --- a/lib/rdoc/parser.rb +++ b/lib/rdoc/parser.rb @@ -85,7 +85,7 @@ class RDoc::Parser if have_encoding then mode = "r" s.sub!(/\A#!.*\n/, '') # assume shebang line isn't longer than 1024. - encoding = s[/^\s*\#\s*(?:-\*-\s*)?(?:en)?coding:\s*\([^\s;]+?\)(?:-\*-)?/, 1] + encoding = s[/^\s*\#\s*(?:-\*-\s*)?(?:en)?coding:\s*([^\s;]+?)(?:-\*-|[\s;])/, 1] mode = "r:#{encoding}" if encoding s = File.open(file, mode) {|f| f.gets(nil, 1024)} |