Skip to content

The url_encode method is wrong #22

Description

@GoogleCodeExporter
What steps will reproduce the problem?
--

Just try to encode anything with "[" in it

Please provide any additional information below.
--

The list_to_integer call is trying to detect if the input list is a string
representation of integer in the given base. What do you really want is the
opposite. You want the integer which represents the character.

5> L = "[".                        
"["
6> [H|T] = L, erlang:integer_to_list(H, 16).  
"5B"

Solution
--

Just replace the erlang:list_to_integer([H], 16) with
erlang:integer_to_list(H, 16) on line 214 in
http://code.google.com/p/ecouch/source/browse/trunk/src/ec_client.erl#214

Original issue reported on code.google.com by m...@nomi.cz on 21 Aug 2009 at 11:53

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions