Printing simplified Chinese characters on Epson TM-T88IVM

Jason Kealey picture Jason Kealey · Dec 21, 2009 · Viewed 11.9k times · Source

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.

Answer

Jason Kealey picture Jason Kealey · Jan 15, 2010

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));