Make utf8::encode respect magic