make sure to encode to utf-8 before calling phpserialize even on Python2
make sure to encode in copy_tree