Encode topic directly