mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
parent
df88d03298
commit
90d1be9952
4 changed files with 18 additions and 7 deletions
|
|
@ -980,15 +980,17 @@ Datasette uses a custom encoding scheme in some places, called **tilde encoding*
|
|||
|
||||
Tilde encoding uses the same algorithm as `URL percent-encoding <https://developer.mozilla.org/en-US/docs/Glossary/percent-encoding>`__, but with the ``~`` tilde character used in place of ``%``.
|
||||
|
||||
Any character other than ``ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789_-`` will be replaced by the numeric equivalent preceded by a tilde. For example:
|
||||
Any character other than ``ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz0123456789_-`` will be replaced by the numeric equivalent preceded by a tilde. For example:
|
||||
|
||||
- ``/`` becomes ``~2F``
|
||||
- ``.`` becomes ``~2E``
|
||||
- ``%`` becomes ``~25``
|
||||
- ``~`` becomes ``~7E``
|
||||
- Space character becomes ``~20``
|
||||
- Space becomes ``+``
|
||||
- ``polls/2022.primary`` becomes ``polls~2F2022~2Eprimary``
|
||||
|
||||
Note that the space character is a special case: it will be replaced with a ``+`` symbol.
|
||||
|
||||
.. _internals_utils_tilde_encode:
|
||||
|
||||
.. autofunction:: datasette.utils.tilde_encode
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue