<?xml version="1.0" encoding="UTF-8"?>
<rename_preset case="none" group="转换" ignoreext="yes" script="yes" type="normal" version="13">
	<from>*</from>
	<to>*</to>
	<script>@script jscript
function OnGetNewName(getNewNameData)
{
        return toSemiangle(getNewNameData.newname);
}

function toSemiangle(str)
{
    var newStr = &apos;&apos;;
    for(var i = 0; i &lt; str.length; i++) {
		//log(str[i]);
		var u = str.charCodeAt(i);
		if (u==12288)
			u=32;
		else if (u &gt; 65280 &amp;&amp; u &lt; 65375)
			u = u-65248;
		else {newStr += str[i]; continue;}
		newStr += String.fromCharCode(u);
    }
    return IllegalReplace(newStr);
}

function IllegalReplace(line){
	line = line.replace(/^\s*/, &quot;&quot;);//删除前面的不可见字符
	//line = line.match(/^.+$/m)[0];//匹配一行
	line = line.replace(/[\|\\\/:]+/g, &quot;_&quot;);//替换无效字符
	line = line.replace(/&lt;/g, &quot;[&quot;).replace(/&gt;/g, &quot;]&quot;);//替换无效字符
	line = line.replace(/[\*\?&quot;]+/g, &quot;&quot;);//替换无效字符
	line = line.replace(/(^\s*|\s*$)/g, &quot;&quot;);//删除前后空格
	//line = line.slice(0,160);//避免文件名过长
	return line;
}

function log(str){DOpus.Output(str,false,true);}</script>
</rename_preset>
