ramonlopes / jzebra

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

Invalid Hex decoding #191

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
.appendHex("xFF") throws NumberFormatException .. Byte with xFF value is -127 
so values should be parsed with '-' minus sign and decreased by 0x80 or enable 
parsing with negative hexadecimal numbers ie "x-3f".

There should be support for printing extended ASCII, as you know JavaScript is 
native in Latin1, so there values x80-x9f has no meaning (maybe in IE?). So 
using .append("\x80") prints typically "?" (and .appendHex("x80") is not 
possible).

Problem occurs on Windows XP SP 3, 32 bit, Java 1.7.0_40. 

Original issue reported on code.google.com by radek.se...@gmail.com on 29 Nov 2013 at 3:08

GoogleCodeExporter commented 8 years ago
Sorry not decreased by 0x80 but expression: val = Short.parseShort( split[i] ); 
if( val > 0x7f ) val = 0x7f - val; data[i] = (byte) val;

Original comment by radek.se...@gmail.com on 29 Nov 2013 at 3:10

GoogleCodeExporter commented 8 years ago
@Radek,

I'm still trying to wrap my head around this.

What does "x80" currently translate to? (It doesn't error for me).

I'm a bit confused by this but I see after reading how Java handles bytes (as 
signed) is why this occurs.  Any more insight would be greatly appreciated.  I 
see it as more of a problem with "xFF", since that prevents "11111111" from 
ever being represented (right?) -Tres

-Tres

Original comment by tres.fin...@gmail.com on 30 Nov 2013 at 5:25

GoogleCodeExporter commented 8 years ago
x80 is currently translated into various characters depenedent on your extended 
ASCII setting (for example http://en.wikipedia.org/wiki/Windows-1250), please 
believe me every character starting x80 ending xff is important, so please test 
everyone. If any fails there is BIG problem .. I had to use .append64() 
function and the code after is functioning but not easy readable.

You can also send command to your printer, set line spacing to x80 dots .. 
another example.

Original comment by radek.se...@gmail.com on 22 Jan 2014 at 5:23

GoogleCodeExporter commented 8 years ago
@Radek,

This is a major bug that we need to address.

I'm not sure how best to fix it.  It wasn't until your post that I realized how 
sever of an issue this is.

If you have a recommendation on how to resolve this, please post it here.  If 
not, I plan on having our new developer address this as part of our 2.0.0 
release in February.

-Tres

Original comment by tres.fin...@gmail.com on 22 Jan 2014 at 9:46

GoogleCodeExporter commented 8 years ago
Backported to 1.8.2 and closed.  Please note: The download for the free version 
hasn't been added to the qz site.  If you need this feature now, please compile 
from source using these instructions:

https://github.com/qzindustries/qz-print/wiki/Compile-qz-print

Original comment by tres.fin...@gmail.com on 24 Apr 2014 at 12:44