How to send slavic chars like č,ć,š,đ,ž to search api using php


I am trying to make application that uses twitter search api. Since I am in Balcans and I need to search tweets from Serbia I need to include special serbian character. But when I put in search query some of those special characters like č,ć,š,đ,ž php magicly transforms it to something wierd and sends to twitter api, and twitter api does not return valid result of course. How to set up these characters in php? My code looks like this:

$twitter = new twitter_class();
$output = $twitter->getTweets($q, 100);//this sends request in format ''. urlencode($q), and parse result and returns output. Query looks almost the same as when I type in search box on twitter, but this query does not returns reasults if č,ć,đ,š or ž are in it. Otherwise it works fine
echo $output;

Sending request code

$ch= curl_init($this->searchURL . urlencode($q));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);

My files are saved as UTF-8 files.