diff --git a/lib/core/byte-data.js b/lib/core/byte-data.js index 778181c9..289a601f 100644 --- a/lib/core/byte-data.js +++ b/lib/core/byte-data.js @@ -3,7 +3,10 @@ const Mode = require('./mode') function ByteData (data) { this.mode = Mode.BYTE - this.data = new Uint8Array(encodeUtf8(data)) + if (typeof (data) === 'string') { + data = encodeUtf8(data) + } + this.data = new Uint8Array(data) } ByteData.getBitsLength = function getBitsLength (length) {