Skip to content
Browse files

Fix use of String#[] in 1.9

  • Loading branch information...
1 parent ebc1e96 commit 315fc2bc69d9ecc88ab85be13bd1ac149ae409e9 @toretore toretore committed Mar 15, 2009
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/rqrcode/qrcode/qr_8bit_byte.rb
View
4 lib/rqrcode/qrcode/qr_8bit_byte.rb
@@ -27,7 +27,9 @@ def get_length
def write( buffer )
( 0...@data.size ).each do |i|
- buffer.put( @data[i], 8 )
+ c = @data[i]
+ c = c.ord if c.respond_to?(:ord)#String#[] returns single-char string in 1.9, .ord gets ASCII pos
+ buffer.put( c, 8 )
end
end
end

0 comments on commit 315fc2b

Please sign in to comment.
Something went wrong with that request. Please try again.