manual/example_file.rb in prawn-1.0.0.rc2 vs manual/example_file.rb in prawn-1.0.0
- old
+ new
@@ -101,16 +101,11 @@
# Read the data from a file in a given package
#
def read_file(folder_name, filename)
data = File.read(File.expand_path(File.join(
File.dirname(__FILE__), folder_name, filename)))
-
- # XXX If we ever have manual files with source encodings other than
- # UTF-8, we will need to fix this to work on Ruby 1.9.
- if data.respond_to?(:encode!)
- data.encode!("UTF-8")
- end
- data
+
+ data.encode(::Encoding::UTF_8)
end
end
end