githubashto / jzebra

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

Euro sign does not print in CP869 #145

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Send a euro sign to the printer
2.Select CP869 encoding from jzebra

What is the expected output? What do you see instead?
Jzebra automatically changes every Euro symbol sent to a question mark. The 
output should contain 0x87 in place of a Euro symbol as per CP868 but it shows 
a "?" i.e. 0x3F according to CP869.

What version of the product are you using? On what operating system?
Version : 1.4.9
Operating System : Windows 7

Original issue reported on code.google.com by furqan.s...@gmail.com on 30 Jul 2013 at 10:29

GoogleCodeExporter commented 9 years ago
What type of printer is this?

Some printers have special commands for switching currency symbol.  Issue 124 
was a similar problem IIRC.
https://code.google.com/p/jzebra/issues/detail?id=124

-Tres

Original comment by tres.fin...@gmail.com on 2 Aug 2013 at 4:51

GoogleCodeExporter commented 9 years ago
I've already looked at Issue 124. In his case, he was having problems with the 
esc/p commands and there was nothing wrong with the applet. He got around to 
printing the euro sign by using CP858 encoding. In my case I cannot use 
anything other than CP869.

It's definitely not a printer issue either. My printer can print the euro 
symbol symbol when hex value 0x87 is sent to it.

The exact problem is that Jzebra is failing to correctly encode the euro 
symbol. Whenever I use applet.append("€") or even applet.append("0x87"), 
Jzebra always encodes this to a question mark "?". It shows a question mark 
even in the Java console, it comes out as a question mark on the printer, and 
it comes out as a question mark even when I print to file.

Since the euro symbol is always encoded to 0x3F i.e a "?" even if it's printed 
on file. I can definitely say that this is not a printer issue.

p.s. Is there a way to bypass the charset encoding for some of the text in the 
whole print string ? OR is there a way to use a different encoding for some 
text and a different encoding for other text in the same print job ?

Thanks a lot

-Furqan

Original comment by furqan.s...@gmail.com on 2 Aug 2013 at 3:24

GoogleCodeExporter commented 9 years ago
@Furqan,

Fortunately, there were some changes made recently that reduce the amount of 
charset encoding that happens within the applet.

This also will add support for sending raw bytes without ever specifying any 
encoding.

The major problem is that Java's strings always decode to bytes using *some* 
default charset.  The new method of sending bytes only will bypass any charset 
decoding touching the data, but will require the data to be sent in a new 
JavaScript-safe hex format, like so:

applet.append("x1Bx00..."); etc.

In your case, "x87" should work.

I will need someone to test this feature for 1.5.4 if you are willing to 
receive a beta version via email.

-Tres

Original comment by tres.fin...@gmail.com on 2 Aug 2013 at 3:57

GoogleCodeExporter commented 9 years ago
Thanks a lot Tres. It would be great if you can send me the beta(a compiled one 
please, if you would).
Just to be clear, I should use applet.append("x87") in order to send hex 0x87 
to the printer right ?

Thanks again.

Original comment by furqan.s...@gmail.com on 2 Aug 2013 at 10:08

GoogleCodeExporter commented 9 years ago
Correct.  I'll email off a copy shortly.

Original comment by tres.fin...@gmail.com on 2 Aug 2013 at 10:32

GoogleCodeExporter commented 9 years ago
I updated to Jzebra 1.5.4 and tried to use applet.append("x87"). But that only 
appended the string "x87" to the output. Then I tried applet.appendHex("87"), 
and I saw a the hex value 0x57 in the output which is equal to 87 in decimal.
I have no idea why this is happening. Can you please help.
Thanks

Original comment by furqan.s...@gmail.com on 7 Aug 2013 at 10:08

GoogleCodeExporter commented 9 years ago
Can you try appendHex("x87");  the appendHex example in sample.HTML should 
reflect this usage.

Original comment by tres.fin...@gmail.com on 7 Aug 2013 at 11:01

GoogleCodeExporter commented 9 years ago
I tried using appendHex("x87"); and I got the following error : 

Error: uncaught exception: java.lang.NumberFormatException: For input string: 
"x8"

Original comment by furqan.s...@gmail.com on 8 Aug 2013 at 12:16

GoogleCodeExporter commented 9 years ago
@Furgan:

Sorry for the mix-up, I had made a typo in this new function.  Sample.html 
didn't have the x's.  It's been corrected now to accept with or without the x's.

Please download Version 1.5.6 here and let me know if it corrects this problem.

https://jzebra.googlecode.com/files/jZebra%201.5.6.zip

-Tres

Original comment by tres.fin...@gmail.com on 8 Aug 2013 at 3:46

GoogleCodeExporter commented 9 years ago
Thank you so much for your help until now Tres. I really appreciate it.

I've tried version 1.5.6 with the following outcomes:

applet.appendHex("x1ax1bx1cx30x40x50x60x70") and 
applet.appendHex("1a1b1c3040506070") correctly output the hex values.

On the other hand applet.appendHex("x1ax1bx1cx30x40x50x60x70x80") and 
applet.appendHex("1a1b1c3040506070x80") do not output any of the hex values as 
all i.e. as soon as I add anything from 0x80 or above, the appendHex() function 
fails.

Original comment by furqan.s...@gmail.com on 8 Aug 2013 at 6:58