Add encoding Option

This commit is contained in:
Sebastian 2019-11-01 10:50:27 +01:00 committed by GitHub
parent 7ebe09cec1
commit 2c45460d90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -199,6 +199,20 @@ export class MoveBinaryData implements INodeType {
default: false, default: false,
description: 'Use data as is and do not JSON.stringify it.', description: 'Use data as is and do not JSON.stringify it.',
}, },
{
displayName: 'Encoding',
name: 'encoding',
type: 'string',
displayOptions: {
show: {
'/mode': [
'binaryToJson',
],
},
},
default: 'ascii',
description: 'Set the encoding of the data stream',
},
], ],
} }
], ],
@ -235,7 +249,7 @@ export class MoveBinaryData implements INodeType {
continue; continue;
} }
const convertedValue = JSON.parse(new Buffer(value.data, 'base64').toString('ascii')); const convertedValue = JSON.parse(new Buffer(value.data, 'base64').toString(options.encoding));
if (setAllData === true) { if (setAllData === true) {
// Set the full data // Set the full data