/** * Public function to encode url parameters * * This function is used to encode path to file before output. * Encoding is done according to RFC 3986 with one exception: * Character '/' is preserved as is. * * @param string $component part of URI to encode * @return string * @since 6.0.0 */ public static function encodePath($component) { return \OC_Util::encodePath($component); }
function testEncodePath() { $component = '/§#@test%&^ä/-child'; $result = OC_Util::encodePath($component); $this->assertEquals("/%C2%A7%23%40test%25%26%5E%C3%A4/-child", $result); }