Example:
var w = DOpus.FSUtil.NewWild;
var n = "Example (Name).txt";
var ew = w.EscapeString(n);
DOpus.Output(ew);
var er = w.EscapeString(n, "r");
DOpus.Output(er);
Output:
Example '(Name').txt
Example \(Name\)\.txt
There's another example here (although you don't want the "b" mode in your situation):