encode source when it's an URL