Closed tweksteen closed 9 years ago
By default, StringIO will use the external string encoding. In most cases, 'UTF-8' will be used. This creates an issue when using StringIO to generate a blob. (By definition, a blob should use 'ASCII-8BIT'): https://github.com/wvanbergen/chunky_png/blob/dc526b4a/lib/chunky_png/datastream.rb#L177
This could easily be fixed by adding str.set_encoding('ASCII-8BIT') after the string creation.
str.set_encoding('ASCII-8BIT')
See point 5 of http://blog.rayapps.com/2013/03/11/7-things-that-can-go-wrong-with-ruby-19-string-encodings/ for further details.
Fixed by #95.
This may have introduced https://github.com/wvanbergen/chunky_png/issues/105
By default, StringIO will use the external string encoding. In most cases, 'UTF-8' will be used. This creates an issue when using StringIO to generate a blob. (By definition, a blob should use 'ASCII-8BIT'): https://github.com/wvanbergen/chunky_png/blob/dc526b4a/lib/chunky_png/datastream.rb#L177
This could easily be fixed by adding
str.set_encoding('ASCII-8BIT')
after the string creation.See point 5 of http://blog.rayapps.com/2013/03/11/7-things-that-can-go-wrong-with-ruby-19-string-encodings/ for further details.