MagicMarcus / mqtt-spy

Automatically exported from code.google.com/p/mqtt-spy
0 stars 0 forks source link

HEX encoding not working properly? #29

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Subscribe to a test topic
2. Publish an HEX encoded value to that topic
3. The result HEX decoded is different than the value sent

What is the expected output? What do you see instead?

I have tested by sending the following HEX sequence: 3f915604fffd
And the result was: efbfbdefbfbd5604efbfbdefbfbd

What version of the product are you using? On what operating system?
I am using the latest beta version on windoes 7 x64

Please provide any additional information below.

Not sure if it is the case, but it looks that is something with JAVA 8, 
probably related to the link below:
http://docs.oracle.com/javase/8/docs/api/java/io/DataInput.html#modified-utf-8

I have attached two files showing the same test with a client using JAVA 7 and 
MQTT-spy (uses JAVA 8).

Original issue reported on code.google.com by thiago.p...@gmail.com on 5 Feb 2015 at 4:36

Attachments:

GoogleCodeExporter commented 9 years ago
I've managed to recreate the problem in Linux. In Windows it seemed fine.

Original comment by kamil.ba...@gmail.com on 10 Feb 2015 at 8:15

GoogleCodeExporter commented 9 years ago
I've implemented a fix in 0.1.8 build 57. Please give it a try. 

The example you gave works fine now.

Note: if you put the hex value, covert it to plain, and back to hex, this might 
become a different string. Hope this doesn't cause any trouble.

Original comment by kamil.ba...@gmail.com on 12 Feb 2015 at 2:48