Skip to content

Instantly share code, notes, and snippets.

@niccolomineo
Last active August 27, 2024 11:51
Show Gist options
  • 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."""
def 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