# Binary to ASCII

**URL:** <https://community.solace.com/t/binary-to-ascii/1895>\
**Category:** Solace Event Broker\
**Tags:** solace-cloud, topics, queue, solacepubsub, api\
**Created:** [April 1, 2024, 7:44am UTC](https://community.solace.com/t/binary-to-ascii/1895 "2024-04-01T07:44:36Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Naruto](https://avatars.discourse-cdn.com/v4/letter/n/6bbea6/32.png) [@Naruto](https://community.solace.com/u/Naruto)\
**Post date:** [April 1, 2024, 7:44am UTC](https://community.solace.com/t/binary-to-ascii/1895/1 "2024-04-01T07:44:36Z")

</div>

Hi @marc.dipasquale@Aaron

How do I convert the data received from queue(lvq) to ASCII or human readable format?

---

<div class="post-metadata">

**Author:** ![Aaron](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/aaron/32/843_2.png) [@Aaron](https://community.solace.com/u/Aaron)\
**Post date:** [April 1, 2024, 10:04am UTC](https://community.solace.com/t/binary-to-ascii/1895/2 "2024-04-01T10:04:38Z")

</div>

What is the binary format? If the payload is encoded with something like Google Protobufs or Avro, you’ll need to deserialize it with the correct format.

If you just want to dump the binary contents to the console, I would suggest using SdkPerf, it is probably the most common/useful Solace utility. You can find it here: [https://solace.com/downloads/](https://solace.com/downloads/) (tick the box “Other” to find it.

There are LOTS of parameters to use with it, but just to dump a message contents to the console, it will look something like:

```xml

sdkperf_lang -cip=<HOST> -cu=<USER>@<VPN> -cp=<PASSWODRD> -sql=<QUEUE_NAME> -qb -md
e.g. ./sdkperf_java.sh -cip=localhost -cu=aaron@default -cp=pw -sql=q1 -qb -md

```

---

<div class="post-metadata">

**Author:** ![Naruto](https://avatars.discourse-cdn.com/v4/letter/n/6bbea6/32.png) [@Naruto](https://community.solace.com/u/Naruto)\
**Post date:** [April 1, 2024, 11:48am UTC](https://community.solace.com/t/binary-to-ascii/1895/3 "2024-04-01T11:48:25Z")

</div>

@Aaron@marc.dipasquale  
I am dumping the message contents on the console itself & the binary format is like this —  
00 00 47 4c aa 21 da 99 21 61 13 84 c3 29 64 5f …GL.!.. !a…)d\_  
79 12 43 4b b7 00 00 53 54 6f 00 00 58 02 00 00 y.CK…S To…X…  
this is not exact binary it contains hex decimals values as well. How do I change it to ASCII ?  
e.g - -./Browser.c -cip= -cu=@ -cp= -sql=\<QUEUE\_NAME

---

<div class="post-metadata">

**Author:** ![Naruto](https://avatars.discourse-cdn.com/v4/letter/n/6bbea6/32.png) [@Naruto](https://community.solace.com/u/Naruto)\
**Post date:** [April 2, 2024, 4:35am UTC](https://community.solace.com/t/binary-to-ascii/1895/4 "2024-04-02T04:35:45Z")

</div>

@Aaron@marc.dipasquale  
After trying the command with C, the output still remains the same as binary & hex decimal.  
The cmd I used —  
/sdkperf\_c -cip= -cu=@ -cp= -sql= -qb -md  
The output I got —  
60 50 5b 5f 79 12 43 be 88 00 00 53 18 fc ff ff `P[_y.C. ...S.... `

` 77 01 00 00 47 9e fa d4 b7 e1 6d 61 13 34 60 50 w...G... ..ma.4` P  
how do I change it to human readable format?

Please help me with this

---

<div class="post-metadata">

**Author:** ![Aaron](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/aaron/32/843_2.png) [@Aaron](https://community.solace.com/u/Aaron)\
**Post date:** [April 2, 2024, 5:31am UTC](https://community.solace.com/t/binary-to-ascii/1895/5 "2024-04-02T05:31:07Z")

</div>

That is ASCII, on the right. Hex codes on left, ASCII equivalent on the right. Anything that’s a valid/printable ASCII char will show up, otherwise SdkPerf substitutes a period `.` char. That’s why you can see the characters P, y, C, S, w, etc… but there are periods for everything else as they are either 0x00, 0x01, or out of range (e.g. \> 0x7f).

There’s nothing more to see here, you’re going to need to know the payload format to know how to deserialize this binary payload correctly.

---

<div class="post-metadata">

**Author:** ![Aaron](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/aaron/32/843_2.png) [@Aaron](https://community.solace.com/u/Aaron)\
**Post date:** [April 2, 2024, 5:32am UTC](https://community.solace.com/t/binary-to-ascii/1895/6 "2024-04-02T05:32:23Z")

</div>

If you find out it’s Google Protobufs, I have a utility that can probably help you.

---

<div class="post-metadata">

**Author:** ![Naruto](https://avatars.discourse-cdn.com/v4/letter/n/6bbea6/32.png) [@Naruto](https://community.solace.com/u/Naruto)\
**Post date:** [April 2, 2024, 6:16am UTC](https://community.solace.com/t/binary-to-ascii/1895/7 "2024-04-02T06:16:43Z")

</div>

@Aaron  
Thanks for the feedback. Few more queries—  
does sdkperf have deserialization mechanisms inbuilt?  
Can I get the data in json format in anyway?  
please share your thoughts on this with the utility.

---

<div class="post-metadata">

**Author:** ![Naruto](https://avatars.discourse-cdn.com/v4/letter/n/6bbea6/32.png) [@Naruto](https://community.solace.com/u/Naruto)\
**Post date:** [April 3, 2024, 3:30am UTC](https://community.solace.com/t/binary-to-ascii/1895/8 "2024-04-03T03:30:41Z")

</div>

Hi @Aaron  
Please help me with the answers

---

<div class="post-metadata">

**Author:** ![Aaron](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/aaron/32/843_2.png) [@Aaron](https://community.solace.com/u/Aaron)\
**Post date:** [April 8, 2024, 3:16am UTC](https://community.solace.com/t/binary-to-ascii/1895/9 "2024-04-08T03:16:25Z")

</div>

Hi again @Naruto . No, SdkPerf has no pluggable capabilities for providing a deserialization mechanism. You’d have to code something yourself if you know the proper encoding format.
