blob: c5f0195a8ffe0a9676e305b98c4c8b5cf75dd676 [file] [log] [blame]
#!/usr/bin/env python
"""
A small Python script that strips non-ascii characters from PEM files,
replacing them with escaped backslashes.
"""
import sys
for line in sys.stdin.buffer:
line = line.decode('utf-8')
line = line.encode('ascii', errors='backslashreplace')
sys.stdout.buffer.write(line)