想用javacript打开本地网页,但路径中有中文就不行了,如何解决?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns= "http://www.w3.org/1999/xhtml " >
<head>
<title> Untitled Page </title>
<script language= "javascript " type= "text/javascript ">
// <!CDATA[
function qswhEncodeURI(str)
{
var m= " ",sp= "! '()*-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~ "
for(var i=0;i <str.length;i++)
{
if(sp.indexOf(str.charAt(i))!=-1)
{
m+=str.charAt(i)
}else
{
var n=str.charCodeAt(i)
var t= "0 "+n.toString(8)
if(n> 0x7ff)
m+=( "% "+(224+parseInt(t.slice(-6,-4),8)).toString(16)+ "% "+(128+parseInt(t.slice(-4,-2),8)).toString(16)+ "% "+(128+parseInt(t.slice(-2),8)).toString(16)).toUpperCase()
else if(n> 0x7f)
m+=( "% "+(192+parseInt(t.slice(-4,-2),8)).toString(16)+ "% "+(128+parseInt(t.slice(-2),8)).toString(16)).toUpperCase()
else if(n> 0x3f)
m+=( "% "+(64+parseInt(t.slice(-2),8)).toString(16)).toUpperCase()
else if(n> 0xf)
m+=( "% "+n.toString(16)).toUpperCase()
else