cldwalker/hirb — Issue #49: Encoding: nvalid byte sequence in US-ASCII on really UTF string
Author: kalabiyau
Created: 2011-11-23 14:14:46+00:00
State: open

````ruby
Invoice.last
Invoice Load (0.4ms) SELECT "invoices".* FROM "invoices" ORDER BY "invoices"."id" DESC LIMIT 1
Hirb Error: invalid byte sequence in US-ASCII
/.rvm/gems/ruby-1.9.3-p0/gems/hirb-0.5.0/lib/hirb/helpers/table.rb:333:in `gsub'
````
but

```
Invoice.last.attributes.each {|k,v| p "#{k} => #{v ? v : "nil"} => #{v.encoding if v.is_a?(String)}"}
Invoice Load (0.3ms) SELECT "invoices".* FROM "invoices" ORDER BY "invoices"."id" DESC LIMIT 1
"id => 143 => "
"name => nil => "
"document => B7_1_Территория_игр_20111107.pdf => UTF-8"
"checked_at => nil => "
"checked_by => nil => "
"upload_date => 2011-01-23 15:26:08 +0300 => "
"tenant_id => nil => "
"created_at => 2011-11-23 15:26:08 +0400 => "
"updated_at => 2011-11-23 15:26:08 +0400 => "
=> {"id"=>143, "name"=>nil, "document"=>"B7_1_Территория_игр_20111107.pdf", "checked_at"=>nil, "checked_by"=>nil, "upload_date"=>Sun, 23 Jan 2011 15:26:08 MSK +03:00, "tenant_id"=>nil, "created_at"=>Wed, 23 Nov 2011 15:26:08 MSK +04:00, "updated_at"=>Wed, 23 Nov 2011 15:26:08 MSK +04:00}
```