write field names in the same encoding as attribute values (fix #4540)
Merge pull request #578 from minorua/fieldname_encoding

write field names in the same encoding as attribute values (fix #4540)