[erlang-questions] Url decoding

Chandru chandrashekhar.mullaparthi@REDACTED
Fri Jul 1 14:32:57 CEST 2011


On 1 July 2011 13:23, Carlo Bertoldi <carlo.bertoldi@REDACTED> wrote:

> On 01/07/2011 14:17, Chandru wrote:
>
>  On 1 July 2011 10:10, Carlo Bertoldi <carlo.bertoldi@REDACTED <mailto:
>> carlo.bertoldi@**ubiquity.it <carlo.bertoldi@REDACTED>>> wrote:
>>
>>    Hello again,
>>     I believe this is a quite common problem, but I couldn't find an
>>    answer to my problem.
>>    I'd like to URL encode/decode strings.
>>    Encoding: edoc_lib:escape_uri("hello hello"). Perfect, but how can
>>    I go back to the original string now?
>>    Is it possible to do it without using external libs, as those
>>    found in Yaws, or ibrowse? or I'll have to include one of those in
>>    my project?
>>
>>
>> The http_uri module which is part of inets is probably what you need.
>>
>> cheers
>> Chandru
>>
>>  Hi Chandru, I looked into http_uri module, but it only exports the parse
> function:
>
> http_uri:parse("http://try.**com/ciao%20ciao <http://try.com/ciao%20ciao>
> ").
> {http,[],"prova.com",80,"/**ciao%20ciao",[]}
>
> This doesn't solve my problem.
>
>
I thought you wanted to URL encode and decode strings. So are the encode and
decode functions in that module not sufficient?

8> edoc_lib:escape_uri("hello hello").
"hello%20hello"

9> http_uri:decode(v(-1)).
"hello hello"

Chandru
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110701/125e0bf6/attachment.htm>


More information about the erlang-questions mailing list