-
Notifications
You must be signed in to change notification settings - Fork 965
Closed
Description
When trying to create a POST with an attachment I'm running into this issue. Here's a simple example:
params = {
name: "Gunter",
attachment: attachment
}
Now, the attachment
is a PDF document generate by prawnPDF. Its encoding is ASCII-8BIT
. (I'm wrapping it in StringIO thingy just so I can do .read
on it)
If I call HTTParty::Request::Body.new(params)
everything is great.
However, if I change Gunter
to Günter
by introducing UTF-8 character I end up with incompatible character encodings: UTF-8 and ASCII-8BIT
. Coming from here: https://github.com/jnunemaker/httparty/blob/master/lib/httparty/request/body.rb#L42
It's basically assumes that attachment's .read
method will always return an UTF-8 encoded payload. Is that always true? What is a sensible work-around here?
Thanks!
adaRn, tomaszgonciarz, khacluan, mpdaugherty, spiman and 8 more
Metadata
Metadata
Assignees
Labels
No labels