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[] = [];