goscape is the simple tool for encoding and decoding web-specific entities such as HTML and URL. This utility follows UNIX philosophy and can be easily composed with another tools
You need to have Go distribution installed on your machine
go get github.com/deff7/goscape
goscape <command> <entity>
Commands:
encode,e- encode (or escape) input text in terms of specified entitydecode,d- decode (or unescape) input text
Supported entities:
html- escape and unescape HTML offending charactersurl- escape and unescape URL querybase64- encode and decode Base64 stringsjson- escape and unescape JSON stored in outher JSON's strings
> printf "abc def/абв" | goscape encode url
abc+def%2F%D0%B0%D0%B1%D0%B2
> goscape decode url
> abc+def%2F%D0%B0%D0%B1%D0%B2
> ^D
abc def/абв