Package encodings :: Module punycode
[hide private]
[frames] | no frames]

Module punycode

Codec for the Punicode encoding, as specified in RFC 3492

Written by Martin v. Löwis.

Classes [hide private]
Codec
IncrementalEncoder
IncrementalDecoder
StreamWriter
StreamReader
Functions [hide private]
 
segregate(str)
3.1 Basic code point segregation
 
selective_len(str, max)
Return the length of str, considering only characters below max.
 
selective_find(str, char, index, pos)
Return a pair (index, pos), indicating the next occurrence of char in str.
 
insertion_unsort(str, extended)
3.2 Insertion unsort coding
 
T(j, bias)
 
generate_generalized_integer(N, bias)
3.3 Generalized variable-length integers
 
adapt(delta, first, numchars)
 
generate_integers(baselen, deltas)
3.4 Bias adaptation
 
punycode_encode(text)
 
decode_generalized_number(extended, extpos, bias, errors)
3.3 Generalized variable-length integers
 
insertion_sort(base, extended, errors)
3.2 Insertion unsort coding
 
punycode_decode(text, errors)
 
getregentry()
Variables [hide private]
  digits = 'abcdefghijklmnopqrstuvwxyz0123456789'

Imports: codecs


Function Details [hide private]

selective_find(str, char, index, pos)

 

Return a pair (index, pos), indicating the next occurrence of char in str. index is the position of the character considering only ordinals up to and including char, and pos is the position in the full string. index/pos is the starting position in the full string.