simplified quoted printable stuff
This commit is contained in:
parent
57756c85a9
commit
9e95797211
2 changed files with 6 additions and 28 deletions
|
@ -1,12 +1,10 @@
|
|||
import {Converter} from "./converter";
|
||||
|
||||
declare var window:any;
|
||||
declare var utf8:any;
|
||||
declare var quotedPrintable:any;
|
||||
|
||||
export class QuotedPrintableDecoder implements Converter {
|
||||
|
||||
private utf8:any = window.utf8;
|
||||
private quotedPrintable:any = window.quotedPrintable;
|
||||
|
||||
getDisplayname():string {
|
||||
return "Decode quoted printable";
|
||||
}
|
||||
|
@ -16,27 +14,6 @@ export class QuotedPrintableDecoder implements Converter {
|
|||
}
|
||||
|
||||
convert(input:string):string {
|
||||
return this.utf8.decode(this.quotedPrintable.decode(input));
|
||||
return utf8.decode(quotedPrintable.decode(input));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
{
|
||||
"id": "decodequotedprintable",
|
||||
"name": "Decode quoted printable",
|
||||
"convert": function (input) {
|
||||
try {
|
||||
return {
|
||||
"status": "OK",
|
||||
"content": utf8.decode(quotedPrintable.decode(input))
|
||||
};
|
||||
} catch (exception) {
|
||||
return {
|
||||
"status": "ERROR",
|
||||
"content": "Invalid quoted printable string."
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
*/
|
|
@ -1,6 +1,7 @@
|
|||
import {Converter} from "./converter";
|
||||
|
||||
declare var window:any;
|
||||
declare var utf8:any;
|
||||
declare var quotedPrintable:any;
|
||||
|
||||
export class QuotedPrintableEncoder implements Converter {
|
||||
|
||||
|
@ -13,6 +14,6 @@ export class QuotedPrintableEncoder implements Converter {
|
|||
}
|
||||
|
||||
convert(input:string):string {
|
||||
return window.quotedPrintable.encode(window.utf8.encode(input));
|
||||
return quotedPrintable.encode(utf8.encode(input));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue