fixed header creation for non-latin characters

I'm not sure that it's correct. Encode was there for some reason? But remobing encode solves problems wih non-latin and mixed headers