Revert "🐛 Use UTF-16LE encoding for manifest XML files"

This reverts commit 4d3666d4c7.
This commit is contained in:
C-3PO 2018-07-05 16:00:47 +02:00
parent 4d3666d4c7
commit 9c7f23ada0
Signed by: c3po
GPG key ID: 62993C4BB4D86F24
2 changed files with 3 additions and 3 deletions

View file

@ -38,7 +38,7 @@ export default async function getManifest(product: Product): Promise<IManifest>
const patchmanifestStream = extractFileStream(firstFile, stream); const patchmanifestStream = extractFileStream(firstFile, stream);
//Convert ArrayBuffer to string //Convert ArrayBuffer to string
const patchmanifestXml = await streamToString(patchmanifestStream, 'utf-16le'); const patchmanifestXml = await streamToString(patchmanifestStream);
//convert XML to JSON-converted XML //convert XML to JSON-converted XML
const patchManifestJson = xmlJs.xml2js(patchmanifestXml) as xmlJs.Element; const patchManifestJson = xmlJs.xml2js(patchmanifestXml) as xmlJs.Element;

View file

@ -1,8 +1,8 @@
import * as stream from 'stream'; import * as stream from 'stream';
import { TextDecoder } from 'util'; import { TextDecoder } from 'util';
export default function streamToString(inputStream: stream.Readable, encoding: string = 'utf-8'): Promise<string> { export default function streamToString(inputStream: stream.Readable): Promise<string> {
const decoder = new TextDecoder(encoding); //utf-8 or utf-16le const decoder = new TextDecoder('utf-8');
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const stringParts: string[] = []; const stringParts: string[] = [];