由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - how to decode these data from users' input at a web site
相关主题
GCC 居然允许变量长度的向量Perl多线程的问题
怎样运行一个 Python script?一个c++小问题
Switch from Matlab to C(C++)?Is there anything wrong with this C++ array initialization?
C++ 无效语句?javascript在browser里面怎么被interpret的?
a question of perl求教excel的一个问题
python gc questionmember and friend
ambiguous operators in c++C++ Q 109: <<, &&
问个弱的问题:能不能开发两种C++的compiler,一种是编译型的,一种是解释型的问一个Python thread的问题
相关话题的讨论汇总
话题: theurl话题: users话题: data话题: input话题: decode
进入Programming版参与讨论
1 (共1页)
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
2
C# code example
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是啥?
1 (共1页)
进入Programming版参与讨论
相关主题
问一个Python thread的问题a question of perl
第一次实现算法,鸡冻啊python gc question
小公司phone interview 兼求建议,谢谢ambiguous operators in c++
为啥C可以当汇编用,JAVA就不可以呢?问个弱的问题:能不能开发两种C++的compiler,一种是编译型的,一种是解释型的
GCC 居然允许变量长度的向量Perl多线程的问题
怎样运行一个 Python script?一个c++小问题
Switch from Matlab to C(C++)?Is there anything wrong with this C++ array initialization?
C++ 无效语句?javascript在browser里面怎么被interpret的?
相关话题的讨论汇总
话题: theurl话题: users话题: data话题: input话题: decode