Advertisement
rfmonk

codecs_bom.py

Jan 29th, 2014
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. #1/usr/bin/env python
  2.  
  3. # this is from The Python
  4. # Standard Library by example
  5. # ISBN13: 9780321767349
  6.  
  7. import codecs
  8. from codecs_to_hex import to_hex
  9.  
  10. for name in ['BOM', 'BOM_BE', 'BOM_LE',
  11.              'BOM_UTF8',
  12.              'BOM_UTF16', 'BOM_UTF16_BE', 'BOM_UTF16_LE',
  13.              'BOM_UTF32', 'BOM_UTF32_BE', 'BOM_UTF32_LE',
  14.              ]:
  15.     print '{:12} : {}'.format(name, to_hex(getattr(codecs, name), 2))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement