Revert "🐛 Use UTF-16LE encoding for manifest XML files"
This reverts commit 4d3666d4c7
.
This commit is contained in:
parent
4d3666d4c7
commit
9c7f23ada0
2 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||||
|
|
|
@ -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[] = [];
|
||||||
|
|
Loading…
Reference in a new issue