google-code-export / jzebra

Automatically exported from code.google.com/p/jzebra
1 stars 0 forks source link

Special danish character - how to print? #88

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
If I try to print danish characters like æøå i get some weird characters 
printed. I can't seem to grasp how to get the correct character table set... 
Don't quite get all the hex stuff...

What is the expected output? What do you see instead?
2.
Expected output is æøå not giberish...

3.
What version of the product are you using? On what operating system?
1.4.5 - run from a webpage on Windows 7 - Printed to a Citizen CT-S310II printer

Please provide any additional information below.

This is part of my code to show how the printer wants the data:
applet.append("\x1b\x21\x08");
applet.append("\x1B\x20\x01");
applet.append("Trådløst internet\n\n");

Original issue reported on code.google.com by jensen.k...@gmail.com on 19 Sep 2012 at 9:59

Attachments:

GoogleCodeExporter commented 9 years ago
This issue is not an issue anymore

Just had to force jZebra encoding to 865

function print() {
          document.jzebra.setEncoding("865");

And 

applet.append("\x1B\x52\x04"); // Initiate Danish I - Code page

Then use \x7 for lowercase ø
and use \x5 for uppercase Ø

Original comment by jensen.k...@gmail.com on 21 Sep 2012 at 12:19

GoogleCodeExporter commented 9 years ago
By the way need to give the credit to Hiroki Tanzawa from Citizen's German 
office for pointing me in the right direction :-)

Original comment by jensen.k...@gmail.com on 21 Sep 2012 at 12:21

GoogleCodeExporter commented 9 years ago
Hello.
Do you know what might be the equivalent for Greek language?
I have found that the setEncoding should be document.jzebra.setEncoding("737");
http://www.ascii-codes.com/cp737.html

To initiate I just used \x1B\x40
should I use something else?
I am missing that point.
Thank you so much, hope you can help!

Original comment by adomv...@gmail.com on 25 Apr 2013 at 8:16

GoogleCodeExporter commented 9 years ago
You may want to try "document.jzebra.setEncoding("cp737");" I think the "cp" is 
needed.  Unfortunately I haven't had the opportunity to test different code 
pages, so any feedback you can provide will be very helpful.

Original comment by tres.fin...@gmail.com on 25 Apr 2013 at 1:50

GoogleCodeExporter commented 9 years ago
For the original poster, I may have found a solution for Danish characters:

Can you try this:

   applet.setEncoding("UTF-8");
   applet.append("\u00E6"); // Unicode for "æ"
   applet.append("\u00F8"); // Unicode for "ø"
   applet.append("\u00E5"); // Unicode for "å"

   // Switch to Nordic/Danish/Norwegian character set
   applet.setEncoding("cp865");

   // Send characters/raw commands to printer
   applet.print();

The line "applet.setEncoding("cp865");" may not be needed if your printer 
supports Unicode.

-Tres

Original comment by tres.fin...@gmail.com on 25 Apr 2013 at 2:28

GoogleCodeExporter commented 9 years ago

Original comment by tres.fin...@gmail.com on 20 Jan 2014 at 1:19

GoogleCodeExporter commented 9 years ago

Original comment by tres.fin...@gmail.com on 20 Jan 2014 at 1:21