URLEncode does not encode spaces

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default URLEncode does not encode spaces

    If I do this
    <a
    href="http://#CGI.SERVER_NAME##CGI.SCRIPT_NAME#?id=#URLEncodedF ormat(UUID)#">
    I get this
    <a
    href="http://#CGI.SERVER_NAME##CGI.SCRIPT_NAME#?id=CC9BD5F2%2DD 60B%2D497E%2D6E64
    41A44715ADCA

    But if I do this
    #URLEncodedFormat("#UUID#")#
    or this
    #URLEncodedFormat(UUID)#
    I get this

    CC9BD5F2%2DD60B%2 D497E%2D6E6441A44715ADCA

    Note the " " (space) in the encoded string.

    This makes it impossible to use in a browser. Is this bug?

    lingo_user Guest

  2. Similar Questions and Discussions

    1. Using URLencode ??
      I have noticed that there seems to be a lot of chatter about using the urlencode feature within CF. I'm curious how it works, and how to use it in...
    2. URLEncode Problem from ASP.NET
      Hi All: In my application I am sending the input values through query string from a datagrid template column,I used URLEncode to encode the URL...
    3. Encode::Arabic, Encode::Korean and Encode::Mapper
      I would like to introduce soon a new namespace to CPAN, Encode::Arabic, and ask the community for a silent consent. The Encode::Arabic...
    4. URLEncode
      Response.Redirect(@".\folder\" + filename); How could I urlencode this statement so that if the filename contains a special character (in my case...
    5. Encode or not to encode, that is the question
      hey all. for a small website, based off of phpnuke. running on a 2.4 down / 512 up cable connection, doing medium traffic. is it worth encoding...
  3. #2

    Default Re: URLEncode does not encode spaces

    This:
    <CFSET UUID = "CC9BD5F2-D60B-497E-6E6441A44715ADCA">
    <CFOUTPUT>
    <h2>#URLEncodedFormat (UUID)#</h2>
    </CFOUTPUT>

    works perfectly for me.

    What version of CF are you using?

    What is your exact code?

    Regards,
    -- MikeR



    MikerRoo Guest

  4. #3

    Default Re: URLEncode does not encode spaces

    Problem solved. I sent the link in a cfmail tag and used the wraptext attribute. This wrapped the UUID and caused the space to appear. Changing wraptext to 100 gave ma a valid value.
    lingo_user Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139