Aion-Format
view release on metacpan or search on metacpan
t/aion/format/url.pm view on Meta::CPAN
use common::sense; use open qw/:std :utf8/; use Carp qw//; use Cwd qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//; use Test::More 0.98; use String::Diff q...
#
# use common::sense;
#
# use List::Util qw//;
# use Encode qw//;
#
# use Exporter qw/import/;
# our @EXPORT = our @EXPORT_OK = grep {
# ref \$Aion::Format::Url::{$_} eq "GLOB"
# && *{$Aion::Format::Url::{$_}}{CODE} && !/^(_|(NaN|import)\z)/n
# } keys %Aion::Format::Url::;
#
#
# #@category escape url
#
# use constant UNSAFE_RFC3986 => qr/[^A-Za-z0-9\-\._~]/;
#
# # ÐÑÐºÐµÐ¹Ð¿Ð¸Ñ Ð·Ð½Ð°Ñение
# sub to_url_param(;$) {
# my ($param) = @_ == 0? $_: @_;
# use bytes;
# $param =~ s/${\ UNSAFE_RFC3986}/$& eq " "? "+": sprintf "%%%02X", ord $&/ge;
# $param
# }
#
# # ÐÑеобÑазÑÐµÑ Ð² ÑоÑÐ¼Ð°Ñ url-паÑамеÑÑов
# sub to_url_params(;$) {
# my ($param) = @_ == 0? $_: @_;
#
# my @R;
# my @S = [$param];
# while(@S) {
# my $u = pop @S;
# my ($x, $key) = @$u;
#
# if(ref $x eq "HASH") {
# push @S, defined($key)
# ? (map [$x->{$_}, "$key\[${\to_url_param}]"], sort keys %$x)
# : (map [$x->{$_}, to_url_param], sort keys %$x)
# ;
# }
# elsif(ref $x eq "ARRAY") {
# push @S, map [$_, "$key\[]"], @$x;
# }
# elsif(!defined $x) {}
# elsif($x eq 1) { unshift @R, $key }
# else {
# unshift @R, join "=", $key, to_url_param $x;
# }
# }
#
# join "&", @R
# }
#
# # ÐпÑеделÑÐµÑ ÐºÐ¾Ð´Ð¸ÑовкÑ. Ð koi8-r и в cp1251 болÑÑие и малÑе бÑÐºÐ²Ñ ÐºÐ°Ðº Ð±Ñ Ð¿Ð¾Ð¼ÐµÐ½ÑлиÑÑ Ð¼ÐµÑÑами, поÑÑÐ¾Ð¼Ñ Ñ Ð¿ÑавилÑной кодиÑовки Ð²ÐµÑ Ð±ÑÐ´ÐµÑ Ð±Ð¾Ð»ÑÑе
# sub _bohemy {
# my ($s) = @_;
# my $c = 0;
# while($s =~ /[а-ÑÑ]+/gi) {
# my $x = $&;
( run in 0.528 second using v1.01-cache-2.11-cpan-75ffa21a3d4 )