Fixed bug with writing of configuration files

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
Fixed unicode encoding for things that are latin-1 encoded like ^3

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>