Permalink
Browse files

Appease the Ruby 1.9 encoding god

  • Loading branch information...
1 parent 10dae44 commit 95d0109b81d12162cb41064e1bc72bc53159aaf3 @jamis jamis committed Jan 5, 2009
Showing with 2 additions and 0 deletions.
  1. +1 −0 lib/ttfunk/subset/base.rb
  2. +1 −0 lib/ttfunk/table/name.rb
@@ -99,6 +99,7 @@ def encode(options={})
table_data = ""
head_offset = nil
tables.each do |tag, data|
+ data.force_encoding('BINARY') if data.respond_to?(:force_encoding)
newfont << [tag, checksum(data), offset, data.length].pack("A4N*")
table_data << data
head_offset = offset if tag == 'head'
View
@@ -13,6 +13,7 @@ def initialize(text, platform_id, encoding_id, language_id)
@platform_id = platform_id
@encoding_id = encoding_id
@language_id = language_id
+ force_encoding('BINARY') if respond_to?(:force_encoding)
end
end

0 comments on commit 95d0109

Please sign in to comment.