HeligPfleigh / react-native-thermal-receipt-printer

A RN library for thermal printer
155 stars 102 forks source link

Rendering Pound Sign issue #149

Closed ipetrovbg closed 1 year ago

ipetrovbg commented 1 year ago

Hello, I was not sure if this had to be a bug report but decided to post it as a bug because the same text worked fine with other ways of printing.

iconv -f UTF-8 -t CP437 print.txt | lp -d <PRINTER> -o raw

I have also checked the issues of this repository and believe that this is not a duplicate.

Current Behavior I'm attaching an image to illustrate what was printed when I used the following configuration options.

      USBPrinter.connectPrinter(000000, 000000)
      .then(() => {
        const lines = [
          "<C>(S21)</C>",
          "------------------------------------------",
          "",
          "Total",
          "£5.00",
          "------------------------------------------",
        ]
        USBPrinter.printText(lines.join(commands.EOL), { encoding: "UTF8" })
      })
      .catch(err => {
        console.log(err)
      })

IMG_8589

Expected Behaviour I would expect to print the pound sign (£) normally

Your Environment

software version
Android 12
react-native 0.64.4
node 14
npm 6.14.15

Please, let me know if I'm doing something I'm not suppose to be doing. Thank you!

ipetrovbg commented 1 year ago

For anyone stumbling upon the same problem I fixed it with using cp857 encoding.