Skip to content

feature: ability to add extra characters not to be encoded in url_encode #114

@DyfanJones

Description

@DyfanJones

Is there any plans in the future to allow extra characters not to be escaped? In python's urllib.parse.quote there is a parameter safe that allows extra characters not to be escaped (https://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote).

My use case:
I am the current maintainer of a package called "paws". That creates a sdk for R to AWS. I need to be able to add the extra characters so that they don't get encoded. Here are the following modes requiring extra "safety".

encodeHost and encodeZone
][!$&'()*+,;=:<>"

encodePath
$&+,/;:=@

encodePathSegment
$&+:=@

encodeFragment
$&+,/;:=?@

See current implementation:
https://github.com/paws-r/paws/blob/01a9200a0c047607e667a211ce68d9653bb887b3/paws.common/R/url.R#L109-L149

I have managed to develop an R url encoder (https://github.com/paws-r/paws/blob/01a9200a0c047607e667a211ce68d9653bb887b3/paws.common/R/url.R#L151-L165). However it does suffer when the string needing to be encode scales up in size.

If this isn't in scope for urltools happy for you to close this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions