Print Simplified Chinese Character using Raw Printing

362 views
Skip to first unread message

xhs...@gmail.com

unread,
Mar 7, 2019, 1:26:09 PM3/7/19
to qz-print
Hi,

I am using Epson TM T82 thermal receipt printer and qz print to print the receipt.
When I try to print the Chinese characters, odd characters produced.

Below is the configs setting and encoding,

var config = qz.configs.create(printer, {encoding: 'GB18030'});

Am I missing something?

Thank you.

Tres Finocchiaro

unread,
Mar 7, 2019, 1:34:42 PM3/7/19
to xhs...@gmail.com, qz-print
We have only had success with:

var config = qz.configs.create("Printer Name", {encoding: 'GB2312'});  // *Epson T88 models with correct firmware.  Toggles EUC encoding, Simplified Chinese
                                            // {encoding: 'GBK'});     // Fuken POS90 ships with GB18030, but 'GBK' is required

--
You received this message because you are subscribed to the Google Groups "qz-print" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

xhs...@gmail.com

unread,
Mar 7, 2019, 1:39:22 PM3/7/19
to qz-print
Hi, thanks for prompt response.

Is there no alternative way?

Tres Finocchiaro

unread,
Mar 7, 2019, 1:40:35 PM3/7/19
to xhs...@gmail.com, qz-print
It is hardware-specific.

The correct encoding should work.

In our experience, the printer must ship with proper Simplified Chinese firmware.

xhs...@gmail.com

unread,
Mar 7, 2019, 1:56:31 PM3/7/19
to qz-print
I see. how to check if the Epson printer I have shipped with proper firmware?

xhs...@gmail.com

unread,
Mar 7, 2019, 2:09:05 PM3/7/19
to qz-print
Sorry, description of that model stated this, not sure what's the encoding.

Hanzi: Simplified Chinese: GB18030-2000: 28,553

Tres Finocchiaro

unread,
Mar 7, 2019, 2:09:09 PM3/7/19
to xhs...@gmail.com, qz-print
We've tried through US retailers and the information is part of Epson China's inventory/product numbers and we were never able to get a confirmation.

You may attempt to contact Epson China, but they can be very difficult to contact someone that knows ESC/POS.  I'm not sure.

If you have another way to find out the data that works, we can look at the raw data for you and try to detect the encoding.


xhs...@gmail.com

unread,
Mar 7, 2019, 2:19:26 PM3/7/19
to qz-print
I see. this is frustrating, there are no other documentation or article could be found as well.

Tres Finocchiaro

unread,
Mar 7, 2019, 2:21:34 PM3/7/19
to xhs...@gmail.com, qz-print
If you print to FILE: and view with GB18030 compatible viewer, is the data correct?

If so, the printer just needs command (or configure) for GB18030.



Tres Finocchiaro

unread,
Mar 7, 2019, 2:29:54 PM3/7/19
to xhs...@gmail.com, qz-print
Can you try this? 

var config = qz.configs.create(printer, {encoding: 'GB18030'});
var printData = [
   '\x1B' + '\x40',  //init command - necessary for proper byte interpretation
   '\x1B' + '\x52' + '\x15', // GB18030 encoding is defined as '15' for equipped printers per https://tinyurl.com/y6pghvc6
   '这句话是简体中文',
   '\x0A' + '\x0A' + '\x0A' + '\x0A' + '\x0A' + '\x0A' + '\x0A',
   '\x0A' + '\x0A' + '\x0A' + '\x0A' + '\x0A' + '\x0A' + '\x0A',
   '\x1B' + '\x69'          // cut paper
];

xhs...@gmail.com

unread,
Mar 7, 2019, 2:36:22 PM3/7/19
to qz-print
Not quite understand, do you mind to explain more?
Message has been deleted
Message has been deleted

Tres Finocchiaro

unread,
Mar 7, 2019, 2:44:54 PM3/7/19
to xhs...@gmail.com, qz-print
If you print to FILE:

Windows 10 supports adding virtual "FILE:" printer, good for testing and troubelshooting.

 and view with GB18030 compatible viewer, is the data correct?

Some text editors may have support for 
GB18030?? Notepad++ is a very popular text editor but does not yet support GB18030. Others?




xhs...@gmail.com

unread,
Mar 7, 2019, 2:50:13 PM3/7/19
to qz-print
Alright, let me try this out first. Thank you.

xhs...@gmail.com

unread,
Mar 7, 2019, 9:25:49 PM3/7/19
to qz-print
Hi Tres,
Just wanted to clarify with you, do you mean

1) Add print to FILE by following the link below:
https://qz.io/wiki/Setting-Up-A-Raw-Printer-in-Windows#for-virtual-printer-file

2) Print to file using qz with code

function printToFile() {
var config = qz.configs.create({ file: "/path/to/output.txt" }); // or "C:\\path\\to\\output.text", etc

var data = [
'Raw Data\n',
'More Raw Data\n',
'Even More Raw Data\n'
];

qz.print(config, data).catch(function(e) { console.error(e); });
}

Kyle La Barge

unread,
Mar 7, 2019, 9:36:12 PM3/7/19
to xhs...@gmail.com, qz-print
Yes 

2) Print to file using qz with code
Instead of printing to a physical file, print to the virtual FILE: printer you created in step 1.

var config = qz.configs.create("Name of File Printer", {encoding: 'GB18030'});


Kyle LaBarge

Message has been deleted
Message has been deleted

xhs...@gmail.com

unread,
Mar 7, 2019, 9:54:07 PM3/7/19
to qz-print
Thanks for your reply.
The qz prompted msg "Error: Specified printer could not be found." after I point it to the name of the file printer.

Kyle La Barge

unread,
Mar 7, 2019, 9:56:47 PM3/7/19
to xhs...@gmail.com, qz-print
Did you restart QZ Tray after adding the printer?

Make sure it is available to QZ Tray by using the "Find All Printers" function in our sample page: https://demo.qz.io/

Kyle LaBarge

xhs...@gmail.com

unread,
Mar 7, 2019, 10:01:42 PM3/7/19
to qz-print
Thanks! Restart QZ Tray did the trick. It can print, but where did the file went to?

Kyle La Barge

unread,
Mar 7, 2019, 10:06:31 PM3/7/19
to xhs...@gmail.com, qz-print
The root of your Documents folder.

Kyle LaBarge

xhs...@gmail.com

unread,
Mar 7, 2019, 10:29:02 PM3/7/19
to qz-print
> >...

Thanks for your help. I opened the file in Visual Studio Code with GB18030 encoding, it did shown the correct Chinese Character.

I think the printer just needs correct configuration for GB18030. Any idea how can I get these info?

Tres Finocchiaro

unread,
Mar 8, 2019, 12:45:48 AM3/8/19
to Kyle La Barge, Xiang Hao Siow, qz-print

Thanks for your help. I opened the file in Visual Studio Code with GB18030 encoding, it did shown the correct Chinese Character. 

I think the printer just needs correct configuration for GB18030. Any idea how can I get these info?

It should be available in the programming guide for you printer.  Unfortunately I was unable to locate it. 

xhs...@gmail.com

unread,
Mar 8, 2019, 2:15:36 AM3/8/19
to qz-print
I see. Normally, which Retailer support do we contact for these kind of issue?

Tres Finocchiaro

unread,
Mar 8, 2019, 2:28:57 AM3/8/19
to Xiang Hao Siow, qz-print
Epson, if you can get a response from them.

xhs...@gmail.com

unread,
Mar 8, 2019, 3:19:12 AM3/8/19
to qz-print
Thanks Tres,
I can't find any Epson support available.

xhs...@gmail.com

unread,
Mar 8, 2019, 5:36:02 AM3/8/19
to qz-print
Hi Tres,

I am reading this post by you
https://groups.google.com/forum/#!topic/qz-print/vO-3EMdeRQE

Do you know where to find the documentation for that?

Tres Finocchiaro

unread,
Mar 8, 2019, 10:02:04 AM3/8/19
to Xiang Hao Siow, qz-print
Hi, thank you for cross-linking that conversation.

That was me talking to another programmer.  The status of this issue is the same.  This issue needs expert from Epson to help.

Lite and myself have spent a long time working on character support and each printer is slightly different.

The Technical Reference Guide for the TM-T82II shows the following:
image.png

Note, it specifies Kanji font, which we did not yet try to change.


Which leads me to search for "Kanji" in the manual linked previously.

I found this BASIC example from the Programming Manual:

PRINT #1, CHR$(&H1C);”C”;CHR$(0); ← Select JIS code system
PRINT #1, CHR$(&H1C);”&”; ← Specify Kanji mode
PRINT #1, CHR$(&H34);CHR$(&H41);
PRINT #1, CHR$(&H3B);CHR$(&H7A); CHR$(&HA);  

I will translate to JavaScript:

PRINT #1, CHR$(&H1C);”C”;CHR$(0); ← Select JIS code system
PRINT #1, CHR$(&H1C);”&”; ← Specify Kanji mode
PRINT #1, CHR$(&H34);CHR$(&H41);
PRINT #1, CHR$(&H3B);CHR$(&H7A); CHR$(&HA);  

var printData = [
   '\x1C' + 'C' + '\x00',    // Select JIS code system
   '\x1C' + '&',             // Specify Kanji mode
   '\x34' + '\x41',          // Character
   '\x3B' + '\x7A', + '\x0A' // Character
];

Please read ESC/POS Application Programming Guide and test various commands with your hardware.  Please let us know what fixes this problem, we are very interested in knowing how to use it.

(you'll need to keep the encoding)
var config = qz.configs.create(printer, {encoding: 'GB18030'});



xhs...@gmail.com

unread,
Mar 8, 2019, 10:52:41 AM3/8/19
to qz-print
On Friday, March 8, 2019 at 10:02:04 PM UTC+7, Tres Finocchiaro wrote:
> Hi, thank you for cross-linking that conversation.
>
> That was me talking to another programmer.  The status of this issue is the same.  This issue needs expert from Epson to help.
>
>
> Lite and myself have spent a long time working on character support and each printer is slightly different.
>
>
> The Technical Reference Guide for the TM-T82II shows the following:
>
>
>
>
>
> Note, it specifies Kanji font, which we did not yet try to change.
>
>
> Some other resources which may help: https://github.com/mike42/escpos-php/issues/596, reference to Kanji is here: https://github.com/mike42/escpos-php/blob/1c2c37b4c0670e0de8e79b25781339d30df5622c/src/Mike42/Escpos/resources/capabilities.json#L1071
>
>
> Which leads me to search for "Kanji" in the manual linked previously.
>
>
> I found this BASIC example from the Programming Manual:
>
>
> PRINT #1, CHR$(&H1C);”C”;CHR$(0); ← Select JIS code system
> PRINT #1, CHR$(&H1C);”&”; ← Specify Kanji mode
> PRINT #1, CHR$(&H34);CHR$(&H41);
> PRINT #1, CHR$(&H3B);CHR$(&H7A); CHR$(&HA);
>
>
> I will translate to JavaScript:
>
>
> PRINT #1, CHR$(&H1C);”C”;CHR$(0); ← Select JIS code system
> PRINT #1, CHR$(&H1C);”&”; ← Specify Kanji mode
> PRINT #1, CHR$(&H34);CHR$(&H41);
> PRINT #1, CHR$(&H3B);CHR$(&H7A); CHR$(&HA);
>
>
> var printData = [
> '\x1C' + 'C' + '\x00', // Select JIS code system
> '\x1C' + '&', // Specify Kanji mode
> '\x34' + '\x41', // Character
> '\x3B' + '\x7A', + '\x0A' // Character
> ];
>
>
> Please read ESC/POS Application Programming Guide and test various commands with your hardware.  Please let us know what fixes this problem, we are very interested in knowing how to use it.
>
>
>
> (you'll need to keep the encoding)
> var config = qz.configs.create(printer, {encoding: 'GB18030'});
>
>
>
>
>
>
>
> - Tres.Fin...@gmail.com

Hi Tres,
Thanks for your reply. I will test it out, one question, when installing the printer driver, should I select the driver with "TM-T82 Receipt (Simplified Chinese)"?

Tres Finocchiaro

unread,
Mar 8, 2019, 11:09:47 AM3/8/19
to xhs...@gmail.com, qz-print
The driver generally shouldn't matter.  That generally will change the language of the print utilities only.

xhs...@gmail.com

unread,
Mar 8, 2019, 8:29:21 PM3/8/19
to qz-print
I see. I have one doubt,
I checked the technical reference, it said
Commands for Kanji (only for Simplified Chinese models and Traditional Chinese models)
Does the printer need to be Simplified Chinese model?

Lite Finocchiaro

unread,
Mar 8, 2019, 11:15:09 PM3/8/19
to xhs...@gmail.com, qz-print
Unfortunately, these questions are best answered by Epson.

You may want to access the firmware settings. Perhaps that will help you determine whether or not this model supports Simplified Chinese.

Turn the printer off.
Press and hold the Feed button.
Turn the printer on. 
Release the feed button. 

From here the printer should print a page with its IP address, firmware version, default character set, and other information. You can enter the settings menu by quick-pressing the feed button X times and then long-pressing the feed button.

Only certain firmware versions support Simplified Chinese or Traditional Chinese, so an Epson dealer should be able to tell you if your model supports it.

Regards,

Lite


On Fri, Mar 8, 2019, 3:04 PM <xhs...@gmail.com> wrote:
I have tried, not working for me. I get the same result.

xhs...@gmail.com

unread,
Mar 9, 2019, 12:17:29 PM3/9/19
to qz-print
Hi Guys,

Sorry, off topic a bit.

Can QZ Tray code below works with the receipt printer that connected with LAN connection? I have only tested with the the printer that connected to USB before. Any setting needed to establish the connection with LAN?

print(printerName:string, data:any) {

qz.websocket.connect().then(function () {

return qz.printers.find(printerName)

}).then(function (printer) {

var config = qz.configs.create(printer);
return qz.print(config, data);

}).then(qz.websocket.disconnect)

.catch(function (e) {
console.error(e);
alert(e);

});
}

Tres Finocchiaro

unread,
Mar 9, 2019, 12:38:14 PM3/9/19
to Xiang Hao Siow, qz-print
Yes, it will work the same with LAN connection.

xhs...@gmail.com

unread,
Mar 9, 2019, 12:42:26 PM3/9/19
to qz-print
Hi Tres, thanks for your answer!
There is no additional setting needed right? just plug and play like the USB connection?

Tres Finocchiaro

unread,
Mar 9, 2019, 12:44:44 PM3/9/19
to Xiang Hao Siow, qz-print
On most OS, USB will install a printer for you.  With IP, you will need to perform these steps.  Depending on your hardware and your preference you can choose to run the driver provided with your printer, or configure it manually.

ESCPOS capable printers (with a few exceptions) don't need a device driver unless plugged in through USB.  We have details for setting up a driver-less printer here: Windows | Mac | Linux


Tres Finocchiaro

unread,
Mar 9, 2019, 1:24:13 PM3/9/19
to Xiang Hao Siow, qz-print
You can choose to use the vendor-supplied driver (setup wizard) or configure manually.  It's up to you.




On Sat, Mar 9, 2019 at 12:52 PM Xiang Hao Siow <xhs...@gmail.com> wrote:
Alright Tres, 

Just to clarify, for LAN printer, i will need to install the printer driver manually and add it as a network printer correct?

Thank you.

xhs...@gmail.com

unread,
Mar 9, 2019, 3:06:46 PM3/9/19
to qz-print
> > > > <br

Alright understood. Thanks alot Tres

xhs...@gmail.com

unread,
Mar 10, 2019, 3:51:49 AM3/10/19
to qz-print
On Friday, March 8, 2019 at 1:34:42 AM UTC+7, Tres Finocchiaro wrote:
> We have only had success with:
>
>
> var config = qz.configs.create("Printer Name", {encoding: 'GB2312'}); // *Epson T88 models with correct firmware. Toggles EUC encoding, Simplified Chinese
> // {encoding: 'GBK'}); // Fuken POS90 ships with GB18030, but 'GBK' is required
> Per: https://qz.io/wiki/Raw-Encoding#escpos-traditional-chinese
>
>
>
>
> - Tres.Fin...@gmail.com
>
>
>
> On Thu, Mar 7, 2019 at 1:26 PM <xhs...@gmail.com> wrote:
> Hi,
>
>
>
> I am using Epson TM T82 thermal receipt printer and qz print to print the receipt.
>
> When I try to print the Chinese characters, odd characters produced.
>
>
>
> Below is the configs setting and encoding,
>
>
>
> var config = qz.configs.create(printer, {encoding: 'GB18030'});
>
>
>
> Am I missing something?
>
>
>
> Thank you.
>
>
>
> --
>
> You received this message because you are subscribed to the Google Groups "qz-print" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+u...@googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

Hi Tres, I have decided to go with Pixel Printing by plain HTML setting, is QZ tray have any documentation on how to formatting the html like print image, etc?

Thank you

Kyle La Barge

unread,
Mar 10, 2019, 12:27:25 PM3/10/19
to Xiang Hao Siow, qz-print
Here you are: 2.0 HTML documentation

Thermal printers sometimes experience quality issues with HTML printing. We've improved the HTML print quality in version 2.1, but has not been officially release yet. We have several clients using the enhanced HTML feature in 2.1 in their production environment, and we fully support it.

If interested:
Let me know if you need any assistance.


xhs...@gmail.com

unread,
Mar 10, 2019, 3:01:39 PM3/10/19
to qz-print
On Sunday, March 10, 2019 at 11:27:25 PM UTC+7, Kyle La Barge wrote:
> Here you are: 2.0 HTML documentation
>
>
> Thermal printers sometimes experience quality issues with HTML printing. We've improved the HTML print quality in version 2.1, but has not been officially release yet. We have several clients using the enhanced HTML feature in 2.1 in their production environment, and we fully support it.
>
>
> If interested:
> here's a link to the 2.1-RC6 installerhere's the 2.1 HTML documentation
Hi Kyle, Thanks for your reference links.
Yes, I did noticed the quality is bad if compared to raw printing. But I think that will be our temporary solution for the chinese character printing issue.

Kyle La Barge

unread,
Mar 10, 2019, 3:04:45 PM3/10/19
to Xiang Hao Siow, qz-print
Have you tried using 2.1? The quality should be much better.

xhs...@gmail.com

unread,
Mar 10, 2019, 5:52:23 PM3/10/19
to qz-print
I will tried when there is time available.
Anyway Kyle, do you know how to open cash drawer with pixel printing?

Kyle La Barge

unread,
Mar 10, 2019, 6:00:58 PM3/10/19
to Xiang Hao Siow, qz-print
If you're using the Epson printer driver, it will support sending both raw commands and pixel jobs.

So, after your pixel job, you can send a separate qz.print(); call with the raw pulse command to open the cash drawer.


Kyle LaBarge

Tres Finocchiaro

unread,
Mar 21, 2019, 11:33:59 AM3/21/19
to Kyle La Barge, Xiang Hao Siow, qz-print
Our Epson sales guys say that the TM-T82 is not available for sale in the United States so they are not able to offer any support on it.

They did mention that Epson Singapore sells it and may be able to offer some support.  Here's the contact information.

Note, please expect a varying level of expertise by support!  They are not used to ESCPOS questions.  Keep mentioning the "ESCPOS programming manual" and possible "Speaking with an engineer".  Don't mention QZ Tray by name, speak to them as if you are trying to send data through C++, C#, Java or BASIC.  They will not help if you mention a 3rd party product.

If they can offer code examples for any of the above computer languages, we can use that to get it working.  Make sure to ask if the printer supports Simplified Chinese and what "commands" will make Simplified Chinese work.  They may come back with something like "The data must be prepared as GB18030" and then you can send them the raw file we created in previous exercise.  Hopefully they will give this information.  This is a popular printer and a very popular language.

image.png

Tres Finocchiaro

unread,
Mar 22, 2019, 10:13:49 PM3/22/19
to Kyle La Barge, Xiang Hao Siow, qz-print
Ok, after studying the Epson manual "TM-T82_eng_trg_revB_01.pdf", I found the following hint... 

"Select print mode(s) for Kanji characters", which seems to be required for several character sets including Traditional Chinese.

image.png

Next, I went back to the programming guide and looked for this text and found a command to enable Kanji characters.  It's referred to as "FS &" (1C 26) and canceled with "FS ." (1C 2E).

image.png

Notice, it says:

"\x1C\x26" // Specify Kanji mode
"\x1C\x2E" // Cancel Kanji mode

I'm not sure if this helps.  It also mentions "JIS", which I believe to be Japanese model, so that part should probably be omitted.

Please let me know if this helps.




Reply all
Reply to author
Forward
0 new messages