Small hack to encode characters outside scope as NUL (char 0)