Advertisement
Guest User

Untitled

a guest
May 7th, 2015
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. def _safe_print(u, errors="replace"):
  2. """Safely print the given string.
  3.  
  4. If you want to see the code points for unprintable characters then you
  5. can use `errors="xmlcharrefreplace"`.
  6. """
  7. s = u.encode(sys.stdout.encoding or "utf-8", errors)
  8. print(s)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement