Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Perl URI::Escape Ruby等效URI.Escape_Ruby_Perl - Fatal编程技术网

Perl URI::Escape Ruby等效URI.Escape

Perl URI::Escape Ruby等效URI.Escape,ruby,perl,Ruby,Perl,有没有办法在Ruby for Perl中获得完全相同的版本 my $verysafe = uri_escape("foo", "\0-\377"); 输出:%66%6F%6F 鲁比: verysafe = URI.escape('foo') 输出foo 不返回相同的输出。在Ruby中,可以将不安全字符作为正则表达式提供。就你而言: URI.escape('foo', /[\0-\377]/) # => "%66%6F%6F"

有没有办法在Ruby for Perl中获得完全相同的版本

my $verysafe = uri_escape("foo", "\0-\377");
输出:
%66%6F%6F

鲁比:

verysafe = URI.escape('foo')
输出
foo


不返回相同的输出。

在Ruby中,可以将不安全字符作为正则表达式提供。就你而言:

URI.escape('foo', /[\0-\377]/) # => "%66%6F%6F"