diff options
Diffstat (limited to 'tools/regression/xsl_reports/utils/char_translation_table.py')
-rw-r--r-- | tools/regression/xsl_reports/utils/char_translation_table.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/regression/xsl_reports/utils/char_translation_table.py b/tools/regression/xsl_reports/utils/char_translation_table.py new file mode 100644 index 0000000000..c2d8fb6c95 --- /dev/null +++ b/tools/regression/xsl_reports/utils/char_translation_table.py @@ -0,0 +1,13 @@ + +import string + +def chr_or_question_mark( c ): + if chr(c) in string.printable and c < 128 and c not in ( 0x09, 0x0b, 0x0c ): + return chr(c) + else: + return '?' + +char_translation_table = string.maketrans( + ''.join( map( chr, range(0, 256) ) ) + , ''.join( map( chr_or_question_mark, range(0, 256) ) ) + ) |