Want the DOpusFactory.StringTools method increases the error argument, rather than a Terminal script to run.
DOpusFactory.StringTools be able to "Decode" or "Encode" exception is thrown when an error occurs or returns a wrong parameter.
Example:
StringTools.Decode(test,"auto") = error