Paginator with special character in URL

Hello,

Trying to build a kind of search engine for hashtag with #.

In my controller , i’m using $search = str_replace('#', '%23', $keyword); and the search works well.

But i want to to use the paginator->sort() and nothing happens, the paginator does not apply the order when i’m looking the toolbar.

I’m using link like this -><?= str_replace('#', '%23', $this->Paginator->sort('nb_share','<span class="glyphicon glyphicon-share"></span>&nbsp;&nbsp;Most shared',['escape' => false,'direction' => 'desc', 'lock' => true]));?>

I’m also using this option <?= $this->Paginator->options([ 'url' => array('controller' => '/search-'.$search.'') ]);?>

The Url is correctly called but the new request is not made.

Thanks by advance for any help.

I finally found the problem but i dont know how to solved it

By using more Paginator option, i found that the page 2 is the same as page 1 and this infinitely.

Is is possible to deal with special character in URL with the paginator ?