From 9c7f23ada06e4fb39a90d1e38f7069796a16f715 Mon Sep 17 00:00:00 2001 From: C-3PO Date: Thu, 5 Jul 2018 16:00:47 +0200 Subject: [PATCH] =?UTF-8?q?Revert=20"=F0=9F=90=9B=20Use=20UTF-16LE=20encod?= =?UTF-8?q?ing=20for=20manifest=20XML=20files"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4d3666d4c756e05287560ab1f0c77d03c751e8d8. --- src/ssn/getManifest.ts | 2 +- src/ssn/streams/streamToString.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ssn/getManifest.ts b/src/ssn/getManifest.ts index df5b3b2..e0e1abb 100644 --- a/src/ssn/getManifest.ts +++ b/src/ssn/getManifest.ts @@ -38,7 +38,7 @@ export default async function getManifest(product: Product): Promise const patchmanifestStream = extractFileStream(firstFile, stream); //Convert ArrayBuffer to string - const patchmanifestXml = await streamToString(patchmanifestStream, 'utf-16le'); + const patchmanifestXml = await streamToString(patchmanifestStream); //convert XML to JSON-converted XML const patchManifestJson = xmlJs.xml2js(patchmanifestXml) as xmlJs.Element; diff --git a/src/ssn/streams/streamToString.ts b/src/ssn/streams/streamToString.ts index 1260e35..97cf953 100644 --- a/src/ssn/streams/streamToString.ts +++ b/src/ssn/streams/streamToString.ts @@ -1,8 +1,8 @@ import * as stream from 'stream'; import { TextDecoder } from 'util'; -export default function streamToString(inputStream: stream.Readable, encoding: string = 'utf-8'): Promise { - const decoder = new TextDecoder(encoding); //utf-8 or utf-16le +export default function streamToString(inputStream: stream.Readable): Promise { + const decoder = new TextDecoder('utf-8'); return new Promise((resolve, reject) => { const stringParts: string[] = [];