if (currentMode === X12_ENCODATION && newMode === X12_ENCODATION) {
      const endpos = Math.min(startpos + 3, msg.length);
      for (let i = startpos; i < endpos; i++) {
        if (!this.isNativeX12(msg.charCodeAt(i))) {
          return ASCII_ENCODATION;