How to convert string to UTF-8 in Perl
I need to know how to convert a string to UTF-8 and then URL escape the result.
The following is an example python script for XML encoding a URL:
$ python
Python 2.2.2 (#1, Feb 24 2003, 19:13:11)
>>> import xml.sax.saxutils
>>> xml.sax.saxutils.escape("http://www.test.org/view?widget=3&count>2")
The encoded URL from the example above is:
http://www.test.org/view?widget=3&count>2
I need to know how to do this perl. Does anyone know how?
Um, I don't see a difference there (maybe you forgot the extra level of escaping needed to deal with the fact that the boards grok html :) ), but I would search CPAN for an appropriate module to do the job.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement