Permalink
Browse files

Merge pull request #7 from moro/master

got ArgumentError when source includes non-ascii chars.
  • Loading branch information...
mark-moseley committed Oct 9, 2011
2 parents 8fcb86e + 4084c4e commit 27d08a73382d10b9d79a765182a2a9b1c74661f8
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/linecache19.rb
View
@@ -333,6 +333,9 @@ def update_cache(filename, use_script_lines=false)
stat = nil
end
lines = SCRIPT_LINES__[name]
+ if "ruby19".respond_to?(:force_encoding)
+ lines.each{|l| l.force_encoding(Encoding.default_external) }
+ end
@@file_cache[filename] = LineCacheInfo.new(stat, nil, lines, path, nil)
@@file2file_remap[path] = filename
return true

0 comments on commit 27d08a7

Please sign in to comment.