percent

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: MIT Imports: 1 Imported by: 14

README

Percent

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 added in v0.2.0

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 added in v0.2.0

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