As your question is written, and assuming that your text is properly UTF-8 encoded to start with, this should work:
$text = 'ąćę';
$result = implode('=', str_split(strtoupper(bin2hex($text)), 2));
If your text is not UTF-8, but some other encoding, then you can use
$utf8 = mb_convert_encoding($text, 'UTF-8', $yourEncoding);
to get it into UTF-8, where $yourEncoding is some other character encoding like 'ISO-8859-1'.
This works because in PHP, strings are just arrays of bytes. So as long as your text is encoded properly to start with, you don't have to do anything special to treat it as bytes. In fact, this code will work for any character encoding you want without modification.
Now, if you want to do quoted-printable, then that's another story. You could try using the function quoted_printable_encode (requires PHP 5.3 or higher).
json_encodeon them but you won't get the values you mentioned.'ącę'instead, should that come out=C4=84=63=C4=99, or=C4=84c=C4=99?)ąćę(that is, U+0105 U+0107 U+0119). And the =XX notation looks suspiciously like MIME quoted-printable encoding to me.84should actually be85; you can URL encode the text to check quickly.