Fix for encoding error which occurs when putting non-latin characters into header