Giter Site home page Giter Site logo

iq-scm / sublimestringencode Goto Github PK

View Code? Open in Web Editor NEW

This project forked from colinta/sublimestringencode

0.0 0.0 0.0 63 KB

Converts characters from one "encoding" to another using a transformation (think HTML entities, not character encodings)

License: Other

Python 100.00%

sublimestringencode's Introduction

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

  1. Using Package Control, install "StringEncode"

Or:

  1. 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
  2. clone this repo

  3. Install keymaps for the commands (see Example.sublime-keymap for my preferred keys)

Commands

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: Uses base64 to encode into base64

base64_decode: Uses base64 to decode from base64

md5_encode: Uses sha package to create md5 hash

sha256_encode: Uses sha package to create sha256 hash

sha512_encode: Uses sha package to create sha512 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

sublimestringencode's People

Contributors

aosaimy avatar bradland avatar colinta avatar dboune avatar gzzz avatar harurow avatar ianneub avatar jpcirrus avatar jshall avatar pandasauce avatar rlstephenpoole avatar sadhasivam avatar scholtes avatar twolfson avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.