From 906ca98d8b46a92bcaf968a96e5a42330bc34da2 Mon Sep 17 00:00:00 2001 From: Romulo Pires Date: Sat, 16 Sep 2017 13:09:22 -0300 Subject: [PATCH 1/2] suport to utf-8 encoding --- .../background-http.android.ts | 12 ++++++++++++ nativescript-background-http/index.d.ts | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/nativescript-background-http/background-http.android.ts b/nativescript-background-http/background-http.android.ts index dc0bb69..6b96887 100644 --- a/nativescript-background-http/background-http.android.ts +++ b/nativescript-background-http/background-http.android.ts @@ -139,6 +139,12 @@ class Task extends ObservableBase { } } + var utf8 = options.utf8; + + if (utf8) { + request.setUtf8Charset(); + } + task.setDescription(options.description); request.setMethod(options.method ? options.method : "GET"); @@ -183,6 +189,12 @@ class Task extends ObservableBase { } } + var utf8 = options.utf8; + + if (utf8) { + request.setUtf8Charset(); + } + request.setNotificationConfig(new (net).gotev.uploadservice.UploadNotificationConfig()); var headers = options.headers; diff --git a/nativescript-background-http/index.d.ts b/nativescript-background-http/index.d.ts index 355cee9..caf9557 100644 --- a/nativescript-background-http/index.d.ts +++ b/nativescript-background-http/index.d.ts @@ -148,4 +148,9 @@ export interface Request { * You can store serialized JSON object. */ description: string; + + /** + * Use utf8 encode in requests + */ + utf8?: boolean; } From 9db03a03f68d623c7a92275aa18ad6915cbc99ff Mon Sep 17 00:00:00 2001 From: Romulo Pires Date: Sat, 16 Sep 2017 13:10:34 -0300 Subject: [PATCH 2/2] suport to utf-8 encoding --- nativescript-background-http/background-http.android.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/nativescript-background-http/background-http.android.ts b/nativescript-background-http/background-http.android.ts index 6b96887..82e3a98 100644 --- a/nativescript-background-http/background-http.android.ts +++ b/nativescript-background-http/background-http.android.ts @@ -139,12 +139,6 @@ class Task extends ObservableBase { } } - var utf8 = options.utf8; - - if (utf8) { - request.setUtf8Charset(); - } - task.setDescription(options.description); request.setMethod(options.method ? options.method : "GET");