algorithm
Click on the red underlined text to get to the source
... NAMEPREP].
Punycode is an instance of a more general algorithm called
Bootstring, which allows strings composed from a small set of "basic"
code points ...
...
* Simplicity: The encoding and decoding algorithms are reasonably
simple to implement. The goals of efficiency and simplicity are
at odds; Bootstring aims at a good balance between them.
...
... code points (the "basic
string"). This section describes the representation. Section 6
"Bootstring algorithms" presents the algorithms as pseudocode.
...
... string"). This section describes the representation. Section 6
"Bootstring algorithms" presents the algorithms as pseudocode.
Sections 7.1 "Decoding traces ...
... traces" trace the
algorithms for sample inputs.
The following sections describe the four techniques used in
...
... that have already been inserted. Section 6.3 "Encoding procedure"
gives a precise algorithm.
...
... or greater than tmax, then t(j) = tmin or tmax, respectively. (In
the pseudocode in section 6 "Bootstring algorithms", the expression
base * (j + 1) is denoted by k for performance reasons.) These t(j)
...
... Bootstring algorithms ...
...
The decoding and encoding algorithms shown in sections 6.2 and 6.3
handle overflow by detecting it whenever it happens. Another
approach is to enforce limits on the inputs that prevent overflow
...
