bitrate16 / peripage-python

Python module and documentation for direct printing on Peripage thermal printers via bluetooth
GNU General Public License v3.0
77 stars 10 forks source link

Accentuated characters, Umlauts #4

Closed kerk1v closed 3 years ago

kerk1v commented 3 years ago

Hi,

it seems accentuated and special characters are not supported and don't print. Any ideas?

Thanks,

bitrate16 commented 3 years ago

@kerk1v, As i've found during testing, this printer supports only printing of ASCII bytes without extended codes (0x00-0x7F), because any character beyond this range will print out a █ character. This printer does not accept Unicode or UTF-8/16/32 strings, only ASCII.

If you're trying to print using writeASCII, this function will try to encode input string and send it as-is, this also may cause some errors, that's why it is deprecated.

If you're trying to print using printASCII or printlnASCII, this functions exclude any characters not in range (0x0A, 0x20-0x7E) to avoid unsafe behavior because none of control codes (0x00-0x09, 0x0B-0x1F) can be printed, printer also can not print any character after 0x7E.

Listed functions use internal printer ability to print raw text. However, in future i'm planning to add function for printing any text just by converting it into picture and sending this picture to the printer

kerk1v commented 3 years ago

Hi, thanks for the clarification. For now, I am solving the issue by preparing the input with imagemagick convert command. Thanks for the great work on this library. I use the printer to print a weather forecast and some news to read in the morning, like a newsticker, all controlled by Huginn and Nodered on a Raspberry Pi 4.