Discover Packages
github.com/byteness/percent
package
module
Version:
v0.2.2
Opens a new window with list of versions in this module.
Published: Jun 21, 2025
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 1
Opens a new window with list of known importers.
README
README
¶
Percent
[!NOTE]
This is a maintained fork of https://github.com/mtibben/percent which seems to be an abandoned project.
Contributions are welcome, but keep in mind this is a side project and maintained on best effort basis!
Package percent escapes strings using percent-encoding
Docs
Expand ▾
Collapse ▴
Documentation
¶
Package percent escapes strings using percent-encoding
percentEncoded := Encode("a.b/c d", "/. ")
fmt.Println(percentEncoded)
fmt.Println(Decode(percentEncoded))
Output:
a%2Eb%2Fc%20d
a.b/c d
Decode does the inverse transformation of Encode, converting each 3-byte encoded substring of the form "%AB" into the hex-decoded byte 0xAB
Encode escapes the string using percent-encoding, converting the runes found in charsToEncode with hex-encoded %AB sequences
Source Files
¶
Click to show internal directories.
Click to hide internal directories.