Community
    • Login

    MIME Tools does not url encode commas?

    Scheduled Pinned Locked Moved General Discussion
    3 Posts 3 Posters 1.2k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Michael LevyM Offline
      Michael Levy
      last edited by

      I was using Notepad++ and the MIME tools plug in to encode URLs.
      It seems that the MIME Tools plugin does not URL encode commas.

      In Notepad++
      a,b => a,b

      However, in tools like www urlencoder org
      a,b => a%2Cb

      I thought commas need to be encoded per rfc3986 section 2.2.

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP Online
        PeterJones @Michael Levy
        last edited by

        @Michael-Levy ,

        Commas hold special meaning in URLs, but can be used in URLs, so to always encode the comma in a URL is just as incorrect as you think it is for Notepad++ to have not encoded them at all.

        If you want to force Notepad++'s MIME Tools plugin to convert the comma, you can use the Full URL Encode command (though you’ll likely complain that it also encodes the a and the b). Or after doing the URL Encode command, you can reselect the text and do a search/replace to convert , into %2C .

        1 Reply Last reply Reply Quote 1
        • guy038G Offline
          guy038
          last edited by

          Hello, @michael-levy, @peterjones and All,

          Some other characters are not %-encoded when using the The Plugins > MIME Tools > URL Encode option

          So, here is a simple regex S/R which will encode the remaining ASCII characters !

          SEARCH (!)|(\$)|(')|(\()|(\))|(\*)|(\+)|(,)|(-)|(\.)|(_)

          REPLACE (?1%21)(?2%24)(?3%27)(?4%28)(?5%29)(?6%2A)(?7%2B)(?8%2C)(?9%2D)(?10%2E)(?11%5F)

          If you do NOT want to encode the _ char, use this S/R :

          SEARCH (!)|(\$)|(')|(\()|(\))|(\*)|(\+)|(,)|(-)|(\.)

          REPLACE (?1%21)(?2%24)(?3%27)(?4%28)(?5%29)(?6%2A)(?7%2B)(?8%2C)(?9%2D)(?10%2E)

          Best Regards,

          guy038

          1 Reply Last reply Reply Quote 2

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better đź’—

          Register Login
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors