@progress/kendo-charts 2.9.0 → 2.10.0-develop.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,8 @@ import { getVersion } from '../utils/index';
7
7
  const BYTE = "byte";
8
8
 
9
9
  export class Utf8Encoder {
10
- constructor() {
10
+ constructor(options = {}) {
11
+ this.includeBOM = options.includeBOM !== undefined ? options.includeBOM : true;
11
12
  this.initProperties();
12
13
 
13
14
  this.mode = DataModeInstances[this.encodingMode];
@@ -39,7 +40,7 @@ export class Utf8Encoder {
39
40
  }
40
41
 
41
42
  encode(str) {
42
- let result = this.utfBOM;
43
+ let result = this.includeBOM ? this.utfBOM : "";
43
44
 
44
45
  for (let i = 0; i < str.length; i++) {
45
46
  result += this.encodeCharacter(str.charCodeAt(i));
@@ -539,7 +539,8 @@ export function calculateDarkModulesRatioScore(darkModules, total) {
539
539
 
540
540
  export function createQRCodeDataEncoder(encoding) {
541
541
  if (encoding && encoding.toLowerCase().indexOf("utf_8") >= 0) {
542
- return new Utf8Encoder();
542
+ const includeBOM = encoding.toLowerCase().indexOf("no_bom") < 0;
543
+ return new Utf8Encoder({ includeBOM });
543
544
  }
544
545
 
545
546
  return new IsoEncoder();
@@ -7,7 +7,8 @@ import { getVersion } from '../utils/index';
7
7
  const BYTE = "byte";
8
8
 
9
9
  export class Utf8Encoder {
10
- constructor() {
10
+ constructor(options = {}) {
11
+ this.includeBOM = options.includeBOM !== undefined ? options.includeBOM : true;
11
12
  this.initProperties();
12
13
 
13
14
  this.mode = DataModeInstances[this.encodingMode];
@@ -39,7 +40,7 @@ export class Utf8Encoder {
39
40
  }
40
41
 
41
42
  encode(str) {
42
- let result = this.utfBOM;
43
+ let result = this.includeBOM ? this.utfBOM : "";
43
44
 
44
45
  for (let i = 0; i < str.length; i++) {
45
46
  result += this.encodeCharacter(str.charCodeAt(i));
@@ -539,7 +539,8 @@ export function calculateDarkModulesRatioScore(darkModules, total) {
539
539
 
540
540
  export function createQRCodeDataEncoder(encoding) {
541
541
  if (encoding && encoding.toLowerCase().indexOf("utf_8") >= 0) {
542
- return new Utf8Encoder();
542
+ const includeBOM = encoding.toLowerCase().indexOf("no_bom") < 0;
543
+ return new Utf8Encoder({ includeBOM });
543
544
  }
544
545
 
545
546
  return new IsoEncoder();