parser: Add encoding constant

Signed-off-by: Michael Buesch <m@bues.ch>
project source: Add dup()

Signed-off-by: Michael Buesch <m@bues.ch>