escape all chars higher than 127 in debug output to <..> to avoid problems with unicode terminals

This commit is contained in:
2018-06-18 17:51:36 +02:00
parent 710a442d31
commit 89d3801a5f
2 changed files with 3 additions and 2 deletions

View File

@ -61,6 +61,7 @@ proc startioc {} {
puts $fd "dbLoadDatabase ../O.Common/streamApp.dbd"
puts $fd "streamApp_registerRecordDeviceDriver"
}
puts $fd "streamSetLogfile StreamDebug.log"
puts $fd "epicsEnvSet STREAM_PROTOCOL_PATH ."
puts $fd "drvAsynIPPortConfigure device localhost:$port"
puts $fd "dbLoadRecords test.db"
@ -172,7 +173,7 @@ proc escape {string} {
append result "\\r"
} elseif {$n == 10} {
append result "\\n"
} elseif {($n & 127) < 32} {
} elseif {$n < 32 || $n >= 127} {
append result [format "<%02x>" $n]
} else {
append result $c