Because the original code for vis() was ported to Go using the []byte{}
notion, this causes issues for multi-rune bytes (which were not
correctly treated -- and caused loss of information).
Fix this by dealing with []rune instead, which better conveys the
concept at hand. In addition, add tests to ensure that this does not
happen again.
Though, we _really_ should move this code into a library which has a
better test suite -- and the parser itself should be reimplemented to be
less ... 80s.
Fixes: #118
Signed-off-by: Aleksa Sarai <asarai@suse.de>
The current Vis() and Unvis() are using the C implementation from
MTREE(8).
But that means that cgo is used, which is not always desired.
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>