ihmwg / python-ihm

Python package for handling IHM mmCIF and BinaryCIF files
MIT License
14 stars 7 forks source link

Prohibit or warn about non-ascii characters in strings #17

Closed benmwebb closed 2 years ago

benmwebb commented 6 years ago

mmCIF files are supposed to be plain 7-bit ASCII, so no accented characters (e.g. the Å symbol). We should check all strings on output and warn/error about any non-ASCII data.

benmwebb commented 2 years ago

Many mmCIF files are UTF-8 encoded these days, so such checks are probably no longer needed. And if desired, we usually work with Python 3 these days, so can use its own character set support to achieve this (e.g. open the output file handle with encoding='ascii', errors='strict' if we really want ASCII output).