percent

package module
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2025 License: MIT Imports: 1 Imported by: 1

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

Documentation

Overview

Package percent escapes strings using percent-encoding

Example
percentEncoded := Encode("a.b/c d", "/. ")
fmt.Println(percentEncoded)
fmt.Println(Decode(percentEncoded))
Output:
a%2Eb%2Fc%20d
a.b/c d

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(s string) string

Decode does the inverse transformation of Encode, converting each 3-byte encoded substring of the form "%AB" into the hex-decoded byte 0xAB

func Encode

func Encode(s string, charsToEncode string) string

Encode escapes the string using percent-encoding, converting the runes found in charsToEncode with hex-encoded %AB sequences

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL