encode to config