StringEncode
Converts characters from one encoding to another using a transformation (think HTML entities, not character encodings).
Details
Installs
- Total 36K
- Win 17K
- Mac 15K
- Linux 5K
Feb 21 | Feb 20 | Feb 19 | Feb 18 | Feb 17 | Feb 16 | Feb 15 | Feb 14 | Feb 13 | Feb 12 | Feb 11 | Feb 10 | Feb 9 | Feb 8 | Feb 7 | Feb 6 | Feb 5 | Feb 4 | Feb 3 | Feb 2 | Feb 1 | Jan 31 | Jan 30 | Jan 29 | Jan 28 | Jan 27 | Jan 26 | Jan 25 | Jan 24 | Jan 23 | Jan 22 | Jan 21 | Jan 20 | Jan 19 | Jan 18 | Jan 17 | Jan 16 | Jan 15 | Jan 14 | Jan 13 | Jan 12 | Jan 11 | Jan 10 | Jan 9 | Jan 8 | Jan 7 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 1 | 3 | 0 | 0 | 5 | 2 | 1 | 2 | 2 | 2 | 1 | 2 | 0 | 2 | 0 | 1 | 0 | 2 | 0 | 0 | 2 | 1 | 1 | 5 | 1 | 1 | 2 | 1 | 1 | 0 | 2 | 2 | 0 | 0 | 0 | 3 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 1 |
Mac | 1 | 1 | 0 | 2 | 3 | 2 | 1 | 0 | 0 | 5 | 2 | 4 | 1 | 2 | 2 | 1 | 3 | 0 | 0 | 0 | 1 | 1 | 2 | 1 | 3 | 0 | 2 | 2 | 4 | 2 | 2 | 5 | 1 | 1 | 0 | 1 | 4 | 0 | 1 | 2 | 0 | 1 | 1 | 1 | 1 | 1 |
Linux | 0 | 1 | 0 | 0 | 1 | 1 | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 2 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
StringEncode
Encodes text. “Encode” in this context refers to HTML entities or URL encoding, not character encodings. Most of these commands work in both directions (e.g. you can encode to html entities, or from html entities).
- Html entities
- Css (e.g. unicode characters)
- Xml entities
- Json strings
- Urls
- Base64 encoding
- Hash: Md5, Sha256, Sha512
- Regex escape
- SQL 'LIKE' escape
- Hexadecimal / Decimal
- Unicode Hexadecimal representation
This plugin was intended to be used with selections, but if you don't have any text selected, it will act on the entire document. This can be handy (if you're base64-encoding a file, for instance), but also have unintended consequences. For instance, you probably should not use URL Decode
on an entire text document.
You can also encode the clipboard, use the string_encode_paste
command, and you will be presented with a menu to choose the encoding, and the clipboard will be encoded and inserted.
Installation
- Using Package Control, install “StringEncode”
Or:
Open the Sublime Text Packages folder
- OS X: ~/Library/Application Support/Sublime Text 3/Packages/
- Windows: %APPDATA%/Sublime Text 3/Packages/
- Linux: ~/.Sublime Text 3/Packages/ or ~/.config/sublime-text-3/Packages
clone this repo
Install keymaps for the commands (see Example.sublime-keymap for my preferred keys)
Commands
This list continues to grow, see Default.sublime-commands for the entire list.
string_encode_paste
: Converts the clipboard to the desired encoding.
html_entitize
: Converts characters to their HTML entity
html_deentitize
: Converts HTML entities to a character
url_encode
: Uses urllib.quote to escape special URL characters.
- Accepts an old_school
argument (default: True
). Setting it to False
will return %20
instead of +
when encoding spaces.
url_decode
: Uses urllib.unquote to convert escaped URL characters
json_escape
: Escapes a string and surrounds it in quotes, according to the JSON encoding.
json_unescape
: Unescapes a string (include the quotes!) according to JSON encoding.
base64_encode
(also base16
, base32
): Uses base16/32/64 to encode into base64
base64_decode
: Decodes from base16/32/64
gzip64_encode
: Gzip and then base64 encode
gzip64_decode
: Base64 decode and then Gunzip
md5_encode
: Uses sha package to create md5 hash
sha256_encode
(also sha1
, sha384
, sha512
): Uses sha package to create sha1/256/384/512 hash
escape_regex
: Escapes regex meta characters
escape_like
: Escapes SQL-LIKE meta characters
safe_html_entitize
: Converts characters to their HTML entity, but preserves HTML reserved characters
safe_html_deentitize
: Converts HTML entities to a character, but preserves HTML reserved characters
xml_entitize
: Converts characters to their XML entity
xml_deentitize
: Converts XML entities to a character