Last active
August 27, 2024 11:51
-
-
Save niccolomineo/46ee170d39637261fbeb53593a07add4 to your computer and use it in GitHub Desktop.
A utiliy to strip the Byte Order Mark from UTF-8 text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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