Recent

Author Topic: [Solved] Printing euro symbol in ticket  (Read 5111 times)

lainz

  • Hero Member
  • *****
  • Posts: 4742
  • Web, Desktop & Android developer
    • https://lainz.github.io/
[Solved] Printing euro symbol in ticket
« on: February 11, 2022, 12:51:41 am »
Hi, we use ESC / POS printer and we need to print the euro symbol.

Any ideas on how to configure that, currently we use:

Code: Pascal  [Select][+][-]
  1. escMultiLang = chr(27) + chr(116) + chr(39); //ISO_8859_1

But in the ticket the euro symbol looks like this (attached image).

« Last Edit: February 11, 2022, 02:42:55 pm by lainz »

Kays

  • Hero Member
  • *****
  • Posts: 632
  • Whasup!?
    • KaiBurghardt.de
Re: Printing euro symbol in ticket
« Reply #1 on: February 11, 2022, 01:21:04 am »
Hi, we use ESC / POS printer and we need to print the euro symbol.
I think this is really hardware specific, how and what kind of output is supported. I suggest to print a sheet, a table enumerating all chr(0) to chr(255). There’s probably a € already included without any escape sorcery. Or overstrike approximation ('C', backspace, '=').
« Last Edit: February 11, 2022, 01:28:54 am by Kays »
Yours Sincerely
Kai Burghardt

jesusr

  • Sr. Member
  • ****
  • Posts: 499
Re: Printing euro symbol in ticket
« Reply #2 on: February 11, 2022, 03:04:15 am »
Hi, we use ESC / POS printer and we need to print the euro symbol.

Any ideas on how to configure that, currently we use:

Code: Pascal  [Select][+][-]
  1. escMultiLang = chr(27) + chr(116) + chr(39); //ISO_8859_1

But in the ticket the euro symbol looks like this (attached image).

If the printer faithfully follows the iso-8859-1 encoding, then it's doing right because iso-8859-1 has no euro sign. You need to convert the UTF-8 characters that Lazarus use to any printer supported encoding that has the euro sign (iso-8859-15 has it at the $A4 position and windows-1252 has it at the $80 position). The LConvEncoding unit makes this easy.

SymbolicFrank

  • Hero Member
  • *****
  • Posts: 1315
Re: Printing euro symbol in ticket
« Reply #3 on: February 11, 2022, 09:46:56 am »
In my experience, this differs from printer to printer, what mode it is running in and the selected font. Read the manual.

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Printing euro symbol in ticket
« Reply #4 on: February 11, 2022, 10:33:41 am »
Hi!

There was a temporary solution for Windows when the Euro was introduced:

The € sign was at #127.

Try that.

Winni

lainz

  • Hero Member
  • *****
  • Posts: 4742
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Printing euro symbol in ticket
« Reply #5 on: February 11, 2022, 02:42:40 pm »
If the printer faithfully follows the iso-8859-1 encoding, then it's doing right because iso-8859-1 has no euro sign. You need to convert the UTF-8 characters that Lazarus use to any printer supported encoding that has the euro sign (iso-8859-15 has it at the $A4 position and windows-1252 has it at the $80 position). The LConvEncoding unit makes this easy.

Thanks, Windows 1252 did the trick

Code: Pascal  [Select][+][-]
  1. escMultiLang2 = chr(27) + chr(116) + chr(16); //WPC_1252

 

TinyPortal © 2005-2018