<?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
// PercentDecode
// Description: Decode percent-encoding (URL encoding).
// Author: @Chaoses-Ib
// Version: 221107
// Homepage: https://github.com/Chaoses-Ib/IbDOpusScripts
function OnGetCustomFields(getFieldData)
{
    getFieldData.fields.replaceAtWithPercentU = true
    getFieldData.field_labels(&apos;replaceAtWithPercentU&apos;) = DOpus.strings.Get(&apos;replaceAtWithPercentU&apos;)
}
function OnGetNewName(getNewNameData)
{
    var s = getNewNameData.newname_stem_m;
    if (getNewNameData.custom.replaceAtWithPercentU)
        s = s.replace(/@([0-9a-fA-F])/g, &apos;%u$1&apos;);
    if (s.indexOf(&apos;%u&apos;) != -1)
        return unescape(s);
    else
        return decodeURIComponent(s);
}
==SCRIPT RESOURCES
&lt;resources&gt;
    &lt;resource type=&quot;strings&quot;&gt;
        &lt;strings lang=&quot;english&quot;&gt;
            &lt;string id=&quot;replaceAtWithPercentU&quot; text=&quot;Replace @hhhh with %uhhhh&quot; /&gt;
        &lt;/strings&gt;
        &lt;strings lang=&quot;chs&quot;&gt;
            &lt;string id=&quot;replaceAtWithPercentU&quot; text=&quot;替换 @hhhh 为 %uhhhh&quot; /&gt;
        &lt;/strings&gt;
    &lt;/resource&gt;
&lt;/resources&gt;</script>
	<custom>
		<var name="replaceAtWithPercentU" type="11">yes</var>
	</custom>
</rename_preset>
