That should be %02x, not %x, or else it will fail for "\x0" to "\xF".
One reason URI::Escape is better is because it fails safely when provided with unicode characters, while your code fails badly.
In reply to Re^2: Character conversion
by ikegami
in thread Character conversion
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |