This would not encode the string. If it is to be an OCTET STRING (sorry, the name is always in caps), it would be encoded as 04 04 9A 20 FF 09 (for the first example). You need the type (04 == OCTET STRING), the length (4) and then the value. This is the TLV (Type, Length, Value) encoding used by SNMP. Other data types are also encoded with TLV, but the type (T) is different. (IIRC, as an IP address this would be 40 04 9A 20 FF 09 for 154.32.255.9).