I got a problem using paperclip gem in rails. I was following this tutorial https://devcenter.heroku.com/articles/paperclip-s3
I got this param in my avatar ActionDispatch::Http::UploadedFile:0x007f5f2bdafde0
that give me this error when i'm using json:
"\xFF" from ASCII-8BIT to UTF-8
So anyone know what i have to do with this param ? I tried to force encode it but it's not working any ideas?
I am using s3 amazon service for upload my avatar.
Don't know if this is helpful or a answer but the best guess that I can give is that the string is a from UploadedFile class is returning a 'ASCII-8BIT'. Best solution for this problem normal is to do something like this on IO.
file.read.force_encoding(Encoding::UTF_8)
This can work for what you are doing however if you don't have access to the line of code your trying to fix it can be difficult.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With