Test whether encoding is valid by recoding a backslash