Improve unicode handling in magic methods

/review @adepue @jeremyhermann