Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Error converting Hex to Ascii

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys,

I have a program that have the function of converting a string of 800 characters in Hex into Ascii.

Bellow the string in Hex:

09dff751ac98c0925a2170de275a31c5462df93e08c1c086e7e277710a66408d01c38792c93819fbbd2bea9177896a2f2c15f7441353bfca30c1f4a97015294133f2e8cb7f4ebd2bfd79aebcb772305a6b1620a89e45344344064d55cff87adfaf026089f7fd3117176ce075cc00ef8279eee9cc782263be3ce4d3c5c88a68213941f4e2c3f6266450f0e0b87395d9677204edd52034c1feeaf2b4cb0d8b629f8dbd6310da4c0c532c1716485c898b4d08a9802947333df8e61195939d42a8605a86624c6db2a7a295417d9d5e6e320aeb7d97cb801ef4345fc745d9c651210c527e5731d1fb5ebff9091136ae338ca2845b2da7575590a496c1e98b7dbbcc2896c1e98b7dbbcc2896c1e98b7dbbcc2896c1e98b7dbbcc2896c1e98b7dbbcc2896c1e98b7dbbcc2896c1e98b7dbbcc2896c1e98b7dbbcc2896c1e98b7dbbcc2896c1e98b7dbbcc2896c1e98b7dbbcc2896c1e98b7dbbcc2896c1e98b7dbbcc2896c1e98b7dbbcc2896c1e98b7dbbcc2896c1e98b7dbbcc2896c1e98b7dbbcc2896c1e98b7dbbcc2896c1e98b7dbbcc28


Bellow the Java program:



The correct output should be:

ß÷Q¬˜À’Z!pÞ'Z1ÅF-ù>ÁÀ†çâwq
f@Ç’É8û½+ê‘w‰j/,÷DS¿Ê0Áô©p)A3òèËN½+ýy®¼·r0Zk ¨žE4CDMUÏøz߯`‰÷ý1làuÌ


But the program converts completely wrong the Hex to Ascii. Bellow the conversion performed.


ß÷Q¬˜À’Z!pÞ'Z1ÅF-ù>ÁÀ†çâwq
f@ǒÉ8û½+ê‘w‰j/,÷DS¿Ê0Áô©p)A3òèËN½+ýy®¼·r0Zk ¨žE4CDMUÏøz߯`‰÷ý1làuÌ


What am I doing wrong in the program?

Thanks,

Fernando
 
Ranch Hand
Posts: 385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have posted code that doesn't even compile:



And then here again:


 
Marshal
Posts: 74654
335
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please start by explaining what the conversions are. 09 does not convert to ß, which is not actually an ASCII character anyway.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic