Note that php5.3 rawurlencode will do exactly the same thing.
For PHP 5.2, easy replacement to this function :
<?php
function rfc3986_encode($str)
{
$str = rawurlencode($str);
$str = str_replace('%E7', '~', $str);
return $str;
}
?>
(PECL OAuth >=0.99.2)
oauth_urlencode — Кодирует URI в соответствии с RFC 3986
uri
URI для кодирования.
Возвращает строку закодированную в соответствии с » RFC 3986.