Epson ESCPOS thermal print with special Danish character

861 Views Asked by At

I am using python-escpos version 2.2.0 for printing text on my Epson TM-T88V thermal receipt printer. My printer is configured:

  1. Using international character set called "DENMARK II"

  2. Using code page WPC1252

I have troubles in printing the extended Danish character æ, ø and å. I have verfied that they exists in WPC1252. Below is my code python code

from escpos import printer

printer_ipAddress = "192.168.0.200"
p = printer.Network(printer_ipAddress)
p.set(align = 'LEFT', width = 2, height = 2)
text = 'æ,ø,å'
p.text(text)
p.cut() 

When I execute above code I get some strange looking character output instead of the Danish character æ, ø and å.

1

There are 1 best solutions below

0
jxw On

As suggested by @kunif the codepage was set inconsistently. I added

p.codepage = 'CP858'

before the p.set command and the issue was solved.