batch to url使用replace方法编码

时间:2017-11-17 17:51:12

标签: windows batch-file urlencode

似乎找不到使用批处理编码网址的方法,所以我记得要替换。

问题是url编码使用%,我认为我的代码无法正常工作。

        @ECHO OFF
    Setlocal EnableDelayedExpansion

    SET varr={"temRazs":{"es":{"ted":[],"items":[{"cod":"1234567","nam":"patrick","where":"ggf","tip":"P",false,"shared":false,"verid":"1064.0ada83b2-3a3f-46a3-95b7-35b8c9ed8f24","className":"myclassname"}}}
        SET varr=!varr:"=%22!
        SET varr=!varr:#=%23!
        SET varr=!varr:$=%24!
        SET varr=!varr:%=%25!
        SET varr=!varr:&=%26!
        SET varr=!varr:'=%27!
        SET varr=!varr:(=%28!
        SET varr=!varr:)=%29!
        SET varr=!varr:*=%2A!
        SET varr=!varr:+=%2B!
        SET varr=!varr:,=%2C!
        SET varr=!varr:-=%2D!
        SET varr=!varr:.=%2E!
        SET varr=!varr:/=%2F!
        SET varr=!varr:0=%30!
        SET varr=!varr:1=%31!
        SET varr=!varr:9=%39!
        SET varr=!varr::=%3A!
        SET varr=!varr:;=%3B!
        SET varr=!varr:<=%3C!
        SET varr=!varr:==%3D!
        SET varr=!varr:>=%3E!
        SET varr=!varr:?=%3F!
        SET varr=!varr:@=%40!
        SET varr=!varr:A=%41!
        SET varr=!varr:[=%5B!
        SET varr=!varr:\=%5C!
        SET varr=!varr:]=%5D!
        SET varr=!varr:^=%5E!
        SET varr=!varr:_=%5F!
        SET varr=!varr:`=%60!
        SET varr=!varr:z=%7A!
        SET varr=!varr:{=%7B!
        SET varr=!varr:|=%7C!
        SET varr=!varr:}=%7D!
        SET varr=!varr:~=%7E!
        SET varr=!varr:,=%B4!
        SET varr=!varr:µ=%B5!
        SET varr=!varr:»=%BB!
        SET varr=!varr:¼=%BC!
        SET varr=!varr:½=%BD!
        SET varr=!varr:¿=%BF!
        SET varr=!varr:À=%C0!
        SET varr=!varr:Á=%C1!
        SET varr=!varr:Â=%C2!
        SET varr=!varr:Ã=%C3!
        SET varr=!varr:Ä=%C4!
        SET varr=!varr:Å=%C5!
        SET varr=!varr:Æ=%C6!
        SET varr=!varr:Ç=%C7!
        SET varr=!varr:È=%C8!
        SET varr=!varr:É=%C9!
        SET varr=!varr:ô=%F4!
        SET varr=!varr:õ=%F5!
        SET varr=!varr:ö=%F6!
        SET varr=!varr:÷=%F7!
    echo 1
    pause
    set urll=!varr!)     
    echo %urll% 
    Pause

任何人都知道如何做到这一点? 完整代码如下(由于堆栈长度问题,没有一些url编码)

{{1}}

由于

0 个答案:

没有答案