h**p 发帖数: 14 | 1 Hi, I have some data which are users' input from a web site.
The data have numerals with '%' after them.
How can I interprete them?
E.g.
aeromonas%e3%80%80starch
starch%e3%80%80microbe
dimer chicken ifn-%ce%b3
Thanks for any help! |
s*v 发帖数: 44 | |
h**p 发帖数: 14 | 3 Thanks! I forgot to say, I'm using Perl.
I tried using:
$theURL = $_;
$theURL =~ tr/+/ /;
$theURL =~ s/%([a-fA-F0-9]{2,2})/chr(hex($1))/eg;
$theURL =~ s///g;
But the result doesn't seem reasonable.
E.g. string "physiol behav 67: 733%e2%80%93738, 1999" was interpreted as "
physiol behav 67: 733â738, 1999".
Thanks! |
r****t 发帖数: 10904 | 4 %e2%80%93 本来应该是什么?what outcome is expected? 是不是个 url decoding 问
题? 这些 string 是什么 codec?
urllib.unquote('abc%20def')
会得到
'abc def'.
不知道是不是你想要的结果,这个是 python. |
h**p 发帖数: 14 | 5 Thanks! I forgot to say, I'm using Perl.
I tried using:
$theURL = $_;
$theURL =~ tr/+/ /;
$theURL =~ s/%([a-fA-F0-9]{2,2})/chr(hex($1))/eg;
$theURL =~ s///g;
But the result doesn't seem reasonable.
E.g. string "physiol behav 67: 733%e2%80%93738, 1999" was interpreted as "
physiol behav 67: 733â738, 1999".
Thanks! |
f*****Q 发帖数: 1912 | 6 提交那人的Accept-Charset和Accept-Language是啥? |