Skip to content

Instantly share code, notes, and snippets.

@tokuhirom
Created December 11, 2008 02:46
Show Gist options
  • Save tokuhirom/34587 to your computer and use it in GitHub Desktop.
Save tokuhirom/34587 to your computer and use it in GitHub Desktop.
undefined
repl(main)> my $search_str = 'かずほ';
$VAR1 = 'かずほ';
repl(main)> my $url = 'http://example.com/search?q=' . (($a = $search_str) =~ s/([^0-9A-Za-z_.!~*'()-])/'%' . uc(unpack('H2', $1))/eg && $a);
$VAR1 = 'http://example.com/search?q=%E3%81%8B%E3%81%9A%E3%81%BB';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment