Handle non-locale file encodings in copyright hook