proper html/url decoding and encoding