Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
24
Task/URL-encoding/Batch-File/url-encoding.bat
Normal file
24
Task/URL-encoding/Batch-File/url-encoding.bat
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
@echo off
|
||||
setlocal enableextensions enabledelayedexpansion
|
||||
for /f "tokens=2 delims=:." %%G in ('chcp') do set _codepage=%%G
|
||||
chcp 65001 >nul
|
||||
set /p str=||goto:eof
|
||||
set tempFile="%temp%\hex-urlencoding.txt"
|
||||
set "letters=ABCDEFGHIKLMNOPQRSTUVWXYZabcdefghiklmnopqrstuvwxyz-._~"
|
||||
<nul set /p=%letters%>%tempFile%
|
||||
certutil -encodehex -f %tempFile% %tempFile% 4 >nul
|
||||
set pos=0
|
||||
for /f "delims==" %%A in ('set char. 2^>nul') do set "%%A="
|
||||
for /f "usebackq tokens=*" %%# in (%tempFile%) do for %%h in (%%#) do (
|
||||
for %%i in (^!pos^!) do set char.%%h=!letters:~%%i,1!
|
||||
set /a pos+=1
|
||||
)
|
||||
<nul set /p"=!str!">%tempFile%
|
||||
certutil -encodehex -f %tempFile% %tempFile% 4 >nul
|
||||
set str=
|
||||
for /f "usebackq tokens=*" %%# in (%tempFile%) do for %%h in (%%#) do (
|
||||
if defined char.%%h (set "str=!str!!char.%%h!") else (set "str=!str!%%%%h")
|
||||
)
|
||||
del %tempFile%
|
||||
echo(!str!
|
||||
chcp %_codepage% >nul
|
||||
Loading…
Add table
Add a link
Reference in a new issue