add tests for references to terminal (latin1, utf8)