Documentation
¶
Overview ¶
Package encoding provides Memegen text encoding and decoding.
Memegen URLs encode special characters in meme text using a set of replacement rules. The encoding order is critical: underscores and dashes must be escaped BEFORE spaces are converted to underscores.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
Decode converts Memegen URL format back to user text.
This reverses Encode by processing replacements in the opposite order:
- Restore tilde-encoded specials and double-quote sequences.
- Restore underscores (double underscore = literal, single = space).
- Restore dashes (double dash = literal dash).
func Encode ¶
Encode converts user text to Memegen URL-safe format.
The replacement order matters:
- Escape literal underscores (_) and dashes (-) by doubling them.
- Convert spaces to underscores.
- Replace remaining special characters with tilde or quote sequences.
func NormalizeQuotes ¶
NormalizeQuotes replaces common Unicode smart quotes and dashes with their ASCII equivalents so that user input from rich-text editors encodes correctly.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.