Fixes #5516

- adds fix into Zend\Mvc\Router\Http\Segment::encode
- adds test case for new fix