react-native-bluetooth-escpos-printer编码Turkısh问题

时间:2019-10-21 08:02:36

标签: javascript react-native encoding printing thermal-printer

我想将本地打印应用程序的打印土耳其语参数发送到bixolon spp-r310打印机。

我的代码是:

async print(BBcolumn, txtObj, isBold, addEnterCount, barcode) {
         let txt = null;
           let result = ‘’;
           let space = ‘’;
           try {
               txt = txtObj;
           } catch (e) {
               console.log(‘Print Methot error : ’ + e);
           }
           let spaceLen = BBcolumn.Lenght - txt.toString().length;
           for (var a = 0; a < spaceLen; a++) {
               space += ' ';
           }
           if (BBcolumn.TextAlign === ‘right’) {
               result = space + txt;
           } else if (BBcolumn.TextAlign === ‘left’) {
               result = txt + space;
           }
           isBold === true ? BluetoothEscposPrinter.setBlob(1) : BluetoothEscposPrinter.setBlob(0);
           for (var i = 0; i < addEnterCount; i++) {
               result += ‘\r\n’;
           }
           if (barcode === true) {
               await BluetoothEscposPrinter.printerInit();
               await BluetoothEscposPrinter.printerAlign(BluetoothEscposPrinter.ALIGN.CENTER);
               await BluetoothEscposPrinter.printBarCode(txtObj.toString(), BluetoothEscposPrinter.BARCODETYPE.CODE128, 3, 70, 0, 2);
               await BluetoothEscposPrinter.printerAlign(BluetoothEscposPrinter.ALIGN.LEFT);
               await BluetoothEscposPrinter.printText(‘\f’, {});
           } else {
               // console.log(result);
               await BluetoothEscposPrinter.printText(result.replace(‘null’, ‘’),
                   {
                       encoding: ‘CP1254’,
                       fonttype: 1,
                   });
           }
       }

我尝试了编码1254和ıso88959-9以及编码857(因为没有大写İ,所以没有)。

1 个答案:

答案 0 :(得分:0)

这是您的解决方案:

process_begin: CreateProcess(NULL, tup --quiet --no-environ-check, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [Makefile:14: all] Error 2
The terminal process terminated with exit code: 1

代码页非常重要。