Fix implementation of SmartUrlEncoder in case of non-ascii characters