it seems i have a little Problem in encoding the IA5String correct:
Given the following definition
mystring IA5String (Size (1..128)) (FROM ("01234567890#*,"))
With the Size Constraint 1..128 the length should be encoded in a Bit
field of size 7.
There are a constraint on the alphabet (a sum of 13 characters) which
lets me encode one character with a bit field of size 4.
If i understand correctly the following mapping should take place:
Alphabet Encoding
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
# 1010
* 1011
, 1100
So, if i want to encode 55#12, the result would be:
0101xxxx 01010101 10100001
0010xxxx
Padding bits are marked with an 'x'.
Is anything in the above true or have i messed up totally ?
0000101x 01010101 10100001
0010xxxx
I presume you're using aligned PER. There are a few problems, but your
basic understanding is not unreasonable.
1. The lower bound of the size begins with 0000000 representing a length
of 1 so a length of 5 would be tranformed to a 4, thus
0000100x
2. Your encoding table is out of order. It should be
# 0000
* 0001
, 0010
0 0011
1 0100
2 0101
3 0110
4 0111
5 1000
6 1001
7 1010
8 1011
9 1100
3. "SIZE" must be in capital letters.
4. Your FROM list includes 0 twice.
So the aligned PER encoding would be
08880450
0000100x length = 4 --> 5
1000 5
1000 5
0000 #
0100 1
0101 2
0000 pad
=====================================================================
Conrad Sigona Voice Mail : 1-732-302-9669 x400
OSS Nokalva Fax : 1-614-388-4156
[EMAIL PROTECTED] My direct line : 1-315-845-1773
_______________________________________________
Asn1 mailing list
[email protected]
http://lists.asn1.org/mailman/listinfo/asn1