added a wrapper service for the native libraries
This commit is contained in:
parent
9e95797211
commit
f5999c5276
7 changed files with 47 additions and 29 deletions
|
@ -1,9 +1,9 @@
|
|||
import {Converter} from "./converter";
|
||||
|
||||
declare var utf8:any;
|
||||
declare var quotedPrintable:any;
|
||||
import {NativeLibraryWrapperService} from "../nativelibrarywrapper.service";
|
||||
|
||||
export class QuotedPrintableDecoder implements Converter {
|
||||
constructor(private nativeLibraryWrapperService:NativeLibraryWrapperService) {
|
||||
}
|
||||
|
||||
getDisplayname():string {
|
||||
return "Decode quoted printable";
|
||||
|
@ -14,6 +14,6 @@ export class QuotedPrintableDecoder implements Converter {
|
|||
}
|
||||
|
||||
convert(input:string):string {
|
||||
return utf8.decode(quotedPrintable.decode(input));
|
||||
return this.nativeLibraryWrapperService.utf8.decode(this.nativeLibraryWrapperService.quotedPrintable.decode(input));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import {Converter} from "./converter";
|
||||
|
||||
declare var utf8:any;
|
||||
declare var quotedPrintable:any;
|
||||
import {NativeLibraryWrapperService} from "../nativelibrarywrapper.service";
|
||||
|
||||
export class QuotedPrintableEncoder implements Converter {
|
||||
constructor(private nativeLibraryWrapperService:NativeLibraryWrapperService) {
|
||||
}
|
||||
|
||||
getDisplayname():string {
|
||||
return "Encode quoted printable";
|
||||
|
@ -14,6 +14,6 @@ export class QuotedPrintableEncoder implements Converter {
|
|||
}
|
||||
|
||||
convert(input:string):string {
|
||||
return quotedPrintable.encode(utf8.encode(input));
|
||||
return this.nativeLibraryWrapperService.quotedPrintable.encode(this.nativeLibraryWrapperService.utf8.encode(input));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue