renamed escape() method to canonicalize()