use global var to store once PREFERRED_ENCODING
PREFERRED_ENCODING = locale.getpreferredencoding()
I think that makes sense. maybe in defs.py (which could really use a comment on what we are supposed to store there as opposed to say in common/gajim)