Fix incorrect url length calculation

using utf8_decode returns the real length