Before sending the q parameter I use PHP’s urlencode. The space is just a regular space. I’ll dive deeper in the used framework to see what exactly is happening there…
Update:
Current function is using rawurlencode (PHP) which returns the string in RFC3986, which is the same as stated in the Twitter V1.1 API docs. In the previous API the following worked: str_replace(’+’, ’ ‘, str_replace(’%7E’, ‘~’, rawurlencode(($string)))); For as far as I know this is still correct and should work.
Update 2:
Finally found the solution: I’m using a PHP framework for Codeigniter (made by elliothaughin, Github). And this framework double encodes the params for some reason. Seems like this was no problem for de V1 API, but it does make a difference for the V1.1 API. For those searching for the specific fix: Remove/comment out line 587 ($v = $this->_encode_rfc3986($v);). Because 3 lines below 587 the concatenated params are encoded (again).
When using the framework from your own Codeigniter code, make sure to use rawurlencode for your parameter values (q=value)