Hi Edmond, 

The PER encoding of that value is as follows:

aligned:

HEX                                              ASCII
01 41                                            .A
Binary dump:
printableString length
00000001 -------- -------- --------    01------    .---

printableString data
-------- 01000001 -------- --------    --41----    -A--

unaligned:

HEX                                              ASCII
01 82                                            ..
Binary dump:
printableString length
00000001 -------- -------- --------    01------    .---

printableString data
-------- 1000001- -------- --------    --------    ----


So the answer to your question for aligned is 1) 65 (41 hex)

Regards, 

Ed Day
Objective Systems, Inc.
REAL WORLD ASN.1 AND XML SOLUTIONS
Tel: +1 (484) 875-3020 
Fax: +1 (484) 875-2913 
Toll-free: (877) 307-6855 (USA only)
mailto:[EMAIL PROTECTED]
http://www.obj-sys.com



----- Original Message ----- 
From: "Edmond G" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 08, 2003 8:28 AM
Subject: [ASN.1] PER Aligned Encoding of PrintableString


> Hi,
> I have a doubt about PER encoding (Aligned) of
> CharacterStrings. For example:
> 
> a PrintableString::= "A"
> 
> Value 'a' would be encoded to 
> 1) 65 in 8 bits or
> 2) 22 in 7 bits. According to the table 5 in X.680 and
> to chapter 26 in X.691 all chars would be encoded in 7
> bits (74 characters in table) and "A" would have the
> index 22.
> 3) 22 in 8 bits (because of the alignment variant). In
> this case there is no advantage using index!
> 
> Thank you in advance
> Ed
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
> 

Reply via email to