Permalink
Browse files

Merge pull request #15 from mitchdenny/unicode

Added unicode converter.
  • Loading branch information...
mitchdenny committed Nov 19, 2017
2 parents 2836d42 + db92bdf commit 89642f6cc2960593aeed5f6e16033b8bf2363216
Showing with 3,395 additions and 70 deletions.
  1. +2 −0 README.md
  2. +3 −0 extension.ts
  3. +39 −0 lib/unicode.ts
  4. +3,278 −0 package-lock.json
  5. +73 −70 package.json
View
@@ -11,6 +11,8 @@ The Encode/Decode (ecdc) extension allows you to quickly convert one or more sel
* String to MD5 Hash (as Base64 String)
* String to HTML Entities
* HTML Entities to String
* String to Unicode
* Unicode to String
## How to Use
View
@@ -1,5 +1,6 @@
import * as core from './lib/core';
import * as urlEncode from './lib/urlEncode';
import * as unicode from './lib/unicode';
import * as crockford32 from './lib/crockford32';
import * as htmlentities from './lib/htmlentities';
import * as base64 from './lib/base64';
@@ -124,6 +125,8 @@ function selectAndApplyTransformation(textEditor: vscode.TextEditor, edit: vscod
new htmlentities.HtmlEntitiesToStringTransformer(),
new crockford32.IntegerToCrockfordBase32Transformer(),
new crockford32.CrockfordBase32ToIntegerTransformer(),
new unicode.StringToUnicodeTransformer(),
new unicode.UnicodeToStringTransformer(),
new urlEncode.StringToEncodedUrlTransformer(),
new urlEncode.EncodedUrlToStringTransformer()
];
View
@@ -0,0 +1,39 @@
import * as core from './core';
var escape = require('unicode-escape');
export class StringToUnicodeTransformer implements core.Transformer {
public get label(): string {
return 'String to Unicode';
}
public get description(): string {
return this.label;
}
public check(input: string): boolean {
return true;
}
public transform(input: string): string {
return escape(input);
}
}
export class UnicodeToStringTransformer implements core.Transformer {
public get label(): string {
return "Unicode to String";
}
public get description(): string {
return this.label;
}
public check(input: string): boolean {
return true;
}
public transform(input: string): string {
return eval('("' + input + '")');
}
}
Oops, something went wrong.

0 comments on commit 89642f6

Please sign in to comment.