Skip to content

Instantly share code, notes, and snippets.

@niccolomineo
Created January 15, 2023 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niccolomineo/46ee170d39637261fbeb53593a07add4 to your computer and use it in GitHub Desktop.
Save niccolomineo/46ee170d39637261fbeb53593a07add4 to your computer and use it in GitHub Desktop.
A utiliy to strip the Byte Order Mark from UTF-8 text
"""Text utils."""
strip_bom(value):
"""Strip Byte Order Mark from UTF-8 text."""
return value.encode("utf-8").decode("utf-8-sig")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment