<meta>正则
程序员文章站
2022-07-02 19:41:00
复制代码 代码如下:var charresult = this.getattribute("responsetext").match(/<...
复制代码 代码如下:
var charresult = this.getattribute("responsetext").match(/<meta.*?\wcharset\s*=\s*(\s+?)["'>\s]/i);
charresult = charresult ? charresult[1] : "gb2312";
上一篇: Gson解析泛型