We have a utf8 helper, but we only use it on URLs, not on any of the parameters. One possible solution could be to add a check in _encodeObjects of ApiRequestor.
I'm pretty suspicious of this. In fact, I'm suspicious of us using utf8_encode at all.
utf8_encode converts latin-1 strings to UTF-8, which isn't an idempotent transformation. That means that if somebody passes in a string that's already UTF-8 encoded, we'll mangle it:
php> var_dump(unpack('C*', utf8_encode("\xc3\xa9")))
I think ideally I'd argue for dropping the utf8 helper entirely and making it the developers' responsibility to pass us UTF-8, though I think in practice that's somewhat tricky. Thoughts?
You can check for something that thinks it is encoded in UTF 8 already though, no?
Hmm, yeah, plausible. I'll try to sketch up something
Make sure values are UTF-8 encoded in POST bodies (fixes #27)