Thread Problem mit URI Encoding (6 answers)
Opened by bianca at 2014-08-17 17:44

bianca
 2014-08-17 17:44
#176891 #176891
User since
2009-09-13
6999 Artikel
BenutzerIn

user image
Hab im Netz diese Zeile gefunden:
$string =~ s/([^^A-Za-z0-9\-_.!~*'()])/ sprintf "%%%0x", ord $1 /eg;

Folgendes Script:
Code (perl): (dl )
1
2
3
4
5
6
7
8
#!/usr/bin/perl
use 5.010;
use strict;
use warnings;

my $string = '?~#';
$string =~ s/([^^A-Za-z0-9\-_.!~*'()])/ sprintf "%%%0x", ord $1 /eg;
say $string;


Ausgabe auf Windows 7:
Quote
%3f~%23

Da die Tilde mit im Regex steht, wieso kommt nicht %3f%7e%23 raus?
10 print "Hallo"
20 goto 10

View full thread Problem mit URI Encoding