revbank/plugins/revspace_ascii
2019-11-07 04:07:31 +01:00

10 lines
396 B
Text

# Hack to work around serial barcode scanner which adds garbage (mostly
# /^[\xFD-\xFF]+/), by stripping everything except printable ASCII, since our
# old IBM terminal doesn't handle non-ascii that well anyway.
# For this plugin to be useful, it needs to be the FIRST in "revbank.plugins".
sub command {
$_[2] =~ s/[^\x20-\x7E]//g; # input is actually a mutable string
return NEXT;
}