LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to decode hex-octets to 8-bit octets, than to 7-bit default alphabet ? (https://www.linuxquestions.org/questions/linux-software-2/how-to-decode-hex-octets-to-8-bit-octets-than-to-7-bit-default-alphabet-719946/)

darius1 04-17-2009 06:18 PM

How to decode hex-octets to 8-bit octets, than to 7-bit default alphabet ?
 
Hi,

I am trying to understand decoding algorithm, to write a shell script
to decode/encode ASCII to hexi-decimal and vice versa.

---
8-bit octets respresenting 7-bit data

decoding

12 hex-octets
C8 F7 1D 14 96 97 41 F9 77 FD 07

C8F71D14969741F977FD07
I should get
"
How are you?
"

I get
LÉFØæ)Ξ:É.ü¥
Å


In the example
8-bit octets are further converted to 7-bit default alphabet

I can provide you with demo converter details from a web page, if you are interested.

Darius

bgoodr 04-18-2009 10:49 AM

Quote:

Originally Posted by darius1 (Post 3512709)
Hi,

I am trying to understand decoding algorithm, to write a shell script
to decode/encode ASCII to hexi-decimal and vice versa.

---
8-bit octets respresenting 7-bit data

decoding

12 hex-octets
C8 F7 1D 14 96 97 41 F9 77 FD 07

C8F71D14969741F977FD07
I should get
"
How are you?
"

I get
LÉFØæ)Ξ:É.ü¥
Å


In the example
8-bit octets are further converted to 7-bit default alphabet

I can provide you with demo converter details from a web page, if you are interested.

Darius

This has been done before in several different ways. Take a look at the uuencode and uudecode programs in your Linux distribution and understand how they work. Then download their source and examine how they go about doing that.

Good Luck,
bgoodr

darius1 04-18-2009 06:07 PM

Quote:

Originally Posted by bgoodr (Post 3513261)
This has been done before in several different ways. Take a look at the uuencode and uudecode programs in your Linux distribution and understand how they work. Then download their source and examine how they go about doing that.

Good Luck,
bgoodr

Thanks.
I need to convert 8-bit octets to 7-bit default alphabet and vice versa.

From uuencode Wikipedia examples
http://en.wikipedia.org/wiki/Uuencode

Uuencode table

The following table represents the subset of ASCII characters used by UUEncode and the 6-bit binary string they represent

(see link above).

Darius


All times are GMT -5. The time now is 11:41 AM.