Hello everybody,
I am using arduino ,HardwareSerial, ESP32,windows 10,
I can print the english words without problem on a mini thermal printer (Fujistu)RS232.
but when i print strings that contains special Turkish letters like(ÇÜĞŞIöüğıç) then i get strange symbols on the printer.
i make some research on internet and find out that the arduino serial deal only with asccii until (127) and this special turkish letters come after (128-->255).
for example:
Ş: print C5 +9F(197+159)
Ç:print195+135
I:73(l in English)
ğ: print196+159
Ğ: print196+158
Ü: print195+156
Ö: print 195+150
ö: print 195+182
according to the research, the problem can solved by using exteded ASCII or by generating the desired font and included it in my code.
i don't know how to generate the ascii code for Turkish and implement it in my code and how to force the printer to print from the generated Turkish font.
Any help or suggestions are welcomed
You can try .write instead of .print to a stream channel.
e.g.
Serial.write((195);
Serial.write((156);
Quite simply this is not true, Arduino serial deals with any value from 0 to 255. In fact 255 is the backwards question mark.
That is because if the font generator inside your thermal printer is producing those strange symbols. As far as I know that font is fixed in a ROM (Read Only Memory) inside your printer and it is impossible to change it.
Does your printer allow you to do graphics? If it did then you could generate graphic strings that would print out your required symbol.
thank you for your quick answer.
the problem is in Arduino serial there is no problem representing special Turkish letters(ÇŞ...) only on the printer it replace them with 2 symbols from the ascii table. This is because the printer deal only with ascii(0-->127) not with the extended ascii(128-->255).
when i write this code from the "TPrinter.h"library
myPrinter.setCodePage(CODEPAGE_ISO_8859_9);
myPrinter.printCodepage();
it prints all Turkish letters without problem.
i think the problem is in extended ascii.
how to solve this problem using generated font for Turkish letters and how to force the printer to read the generated font not the ascii.
any suggestions are very appreciated
Do you have the user manual for your Fujitsu printer that details the serial commands?
Can you provide a short sketch that demonstrates the problem you are having?
Okay, so the printer has the font, what you're asking is how do I use that font from Arduino? Does Tprinter.h have an example you could capture and embed here in code tags, so we can explain what the code is doing?
C
You've still not provided any details of library you are using or the test sketch you are using.
As a guess, I'm assuming that you may be using the Adafruit Thermal Printer library. If you are, then looking at the github page, there is an example sketch: examples->B_charsets->B-charsets.ino that sets up a character set and codepage and then prints out all the characters from ASCII value 32 upwards. You could try that sketch and see what happens. Note the use of the write() function.
That's not really the name of the library - just the name of one of the header files. Where did you get the library from? Please provide a link to it, and please tell us the model number of your printer.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.