| 发表于:2007-10-13 22:55:45 楼主 |
请问一个网页的编码内容是“澳洲”中文是“澳洲” 请问有什么方法解码吗?这个东西,我已经写好了程序解码,请问c#有内置的函数处理吗? 这个是我写的,但效率有点慢,就是想如果有内置的,就好了。 protected string unino2char(string instr) { string tempstr, tempstr1; string pattern = @"&#\d{5};"; char c; while (regex.ismatch(instr, pattern) == true) { tempstr = regex.match(instr, pattern).tostring(); tempstr1 = tempstr.substring(2, 5); c = convert.tochar(convert.toint32(tempstr1)); instr = instr.replace(tempstr, c.tostring()); } return instr; } |
|
|
|
|