I’ve had the same problem just 15 minutes before.
I’ve looked for an answer that works properly but I haven’t found anything right.
Now I already fixed 
It’s not a string encoding issue. It just a string issue, more exactly the quotes. At least for me.
I’m using abraham’s “twitteroauth” and i’ve notice that i was passing the four parameters (costumer_key,costumer_secret,oauth_key & oauth_secret) between quotes. I use variables to defines it and it treats them like strings. That’s was the problem.
I pull quotes out and everything works fine.
I hope it will be useful for all you.