Does Windows have any built-in utility to encode/decode URL?
Asked Answered
R

2

8

The certutil utiliiy in Windows can be used to perform Base64 encoding and deocding. Is there any built-in utility for URL encoding and decoding? There are many free tools available on web. But I am specifically looking for Windows built-in utility or if not simple script that can run on Windows.

Thanks!

Rudderhead answered 24/12, 2015 at 5:36 Comment(4)
Encoding/decoding between a URL and Base64 or do you mean things like InternetCanonicalizeUrl and UrlEscapeJuror
I meant encoding certain characters in a URL by replacing them with one or more character triplets that consist of the percent character "%" followed by two hexadecimal digits.Rudderhead
sourceforge.net/projects/gbm64 for base64 encode/decode; sourceforge.net/projects/urlexam for url encode/decodeWomanize
@zedfoxus, I cannot "download" any external tool in my office.Rudderhead
W
15

Base64 VBA

Base64 encoding and decoding can be done with VBA. You can copy/paste this code and put it in Excel VBA, for example, and then use it's methods to encode and decode Base64.

URL encode/decode VBA

How can I URL encode a string in Excel VBA? and Does VBA have any built in URL decoding? is a URL decoder. Using these tools you should be able to encode and decode within Windows environment with MS Office products such as Excel and VBA.

Base64 PowerShell

If you use powershell, check this out: http://vstepic.blogspot.com/2013/02/how-to-convert-string-to-base64-and.html. Excerpt from that site:

PS C:\Temp>$b  = [System.Text.Encoding]::UTF8.GetBytes("Hello World")
PS C:\Temp>[System.Convert]::ToBase64String($b)
SGVsbG8gV29ybGQ=

PS C:\Temp>$b  = [System.Convert]::FromBase64String("SGVsbG8gV29ybGQ=")
PS C:\Temp>[System.Text.Encoding]::UTF8.GetString($b)
Hello World

URL encode/decode PowerShell

For URL encode/decode you could use:

[Reflection.Assembly]::LoadWithPartialName("System.Web") | Out-Null
[System.Web.HttpUtility]::UrlEncode("http://test.com/?path=what is")
http%3a%2f%2ftest.com%2f%3fpath%3dwhat+is

[System.Web.HttpUtility]::UrlDecode("http%3a%2f%2ftest.com%2f%3fpath%3dwhat+is")
http://test.com/?path=what is

Reference: https://gallery.technet.microsoft.com/scriptcenter/Encoding-and-Decoding-URL-99dc4256

Womanize answered 24/12, 2015 at 6:2 Comment(3)
Does poweshell solution needs .net framework installed on machine?Rudderhead
Yes (technet.microsoft.com/en-us/library/hh847769.aspx). Powershell requires .NET frameworkWomanize
Thanks! I will go ahead with Powershell script solution.Rudderhead
S
2

For me [System.Net.WebUtility] worked instead of [System.Web.HttpUtility]

Supertonic answered 25/4, 2018 at 8:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.