Printing simplified Chinese characters on Epson TM-T88IVM
Asked Answered
E

1

7

I am trying to print Chinese characters on an Epson TM-T88IV M (parallel port) using the Microsoft Point of Service SDK in C#. However, they appear as questions marks on the printer. (?)

My PosPrinter has the following valid CharacterSetList : 255,437,850,852,858,860,863,865,866,936,998,999,1252

And the following CapCharacterSet: Kanji

Code page 1252 is the default windows code page. 936 is the code page for simplified Chinese. In this case, I am using code page 936 but have never been able to display Chinese characters on the printer.

Example:

string str = "重新开始";
// open device as variable _ReceiptPrinter, claim it, mark it as enabled 
_ReceiptPrinter.CharacterSet = 936;
_ReceiptPrinter.PrintNormal(PrinterStation.Receipt, str);

This prints out the text with all Chinese characters replaced with ?.

I am not sure if I need to specify additional escape codes before printing (ESC R 15?) or if my printer is misconfigured in Epson OPOS (v2.50e). I tried a number of things, but nothing has worked. Any ideas or code examples?

Note: in its self test, the printer does print Chinese characters.

Ehling answered 21/12, 2009 at 19:10 Comment(3)
What's charset in your example? Also, Kanji != Simplified Chinese.Glume
charset == 936 (Code page for simplified Chinese); Kanji is the CapCharSet enum value. I was hoping for unicode, but assumed that Epson defines it as Kanji for lack of a better choice (and I don't think this printer supports all of unicode, just the specific subset for simplified Chinese) public enum CharacterSetCapability { Numeric = 0, Alpha = 1, Kana = 10, Kanji = 11, Unicode = 997, Ascii = 998, Windows = 999, Ansi = 999, }Ehling
Hi Jason, how did you check the valid character set list in the printer? The answer below works when I tested on Simplified Chinese (936), but doesn't work on Traditional Chinese (950)Revamp
E
4

The Epson TM-T88IV Multilingual requires that you convert the string into CodePage 936 and then represent that string in ISO-8859-1.

See this other question for details on the algorithm:

Can we simplify this string encoding code

do this before sending to printer. str = Encoding.GetEncoding("ISO-8859-1").GetString(Encoding.GetEncoding(_ReceiptPrinter.CharacterSet).GetBytes(str));

Ehling answered 15/1, 2010 at 16:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.