在Epson TM-T88IVM上打印简体中文字符

Jas*_*ley 7 printing epson opos point-of-sale

我正在尝试使用C#中的Microsoft Point of Service SDK在Epson TM-T88IV M(并行端口)上打印中文字符.但是,它们在打印机上显示为问号.(?)

我的PosPrinter具有以下有效的CharacterSetList:255,437,850,852,858,860,863,865,866,936,998,999,1252

以下CapCharacterSet:汉字

代码页1252是默认的Windows代码页.936是简体中文的代码页.在这种情况下,我使用的是代码页936,但从未能在打印机上显示中文字符.

例:

string str = "????";
// open device as variable _ReceiptPrinter, claim it, mark it as enabled 
_ReceiptPrinter.CharacterSet = 936;
_ReceiptPrinter.PrintNormal(PrinterStation.Receipt, str);
Run Code Online (Sandbox Code Playgroud)

这打印出所有中文字符替换为?的文本.

我不确定是否需要在打印前指定其他转义码(ESC R 15?)或者我的打印机在Epson OPOS(v2.50e)中配置错误.我尝试了很多东西,但没有任何效果.任何想法或代码示例?

注意:在自检中,打印机会打印中文字符.

Jas*_*ley 4

Epson TM-T88IV Multilingual 要求您将字符串转换为 CodePage 936,然后用 ISO-8859-1 表示该字符串。

有关算法的详细信息,请参阅另一个问题:

我们可以简化这个字符串编码代码吗

在发送到打印机之前执行此操作。str = Encoding.GetEncoding("ISO-8859-1").GetString(Encoding.GetEncoding(_ReceiptPrinter.CharacterSet).GetBytes(str));