URLEncode not working as expected

Results 1 to 2 of 2

Thread: URLEncode not working as expected

  1. #1
    Join Date
    Dec 1969

    Default URLEncode not working as expected

    I have a recordset that I am callin from an Access db and I am having trouble with URLEncode. The entries in the field (text) I am calling are document names and have spaces in them. In order to have NN "see" them I am using <BR><BR>&#060;% response.write Server.URLEncode (RS("pub_name")) %&#062;.pdf"&#062;&#060;%= RS("pub_name")%&#062;&#060;/a&#062;<BR><BR>but all the spaces are being replaced with plus signs (+) instead of %20 &#039;s. <BR><BR>Anybody have any insight?<BR><BR>Greg

  2. #2
    Join Date
    Dec 1969

    Default Actually, it is...

    The spec for encoding says that spaces *should* be replaced with +.<BR><BR>The problem is, you aren&#039;t *supposed* to URLEncode (or need to URLEncode) file names, where the %20 is needed.<BR><BR>Better to simply use REPLACE on file names. If there are any characters other than space that don&#039;t work in some browser, you&#039;ll be hosed anyway!<BR><BR>&#060;% = Replace(RS("pub_name")," ","%20") %&#062;<BR><BR><BR>

Posting Permissions

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