remove old encoding code and inline URI escaping instead