Additional top-level class in compilation unit: StringSubsequenceIterator.
codecs module (in Lib/codecs.py). It corresponds approximately to
CPython's Python/codecs.c.
The class also contains the inner methods of the standard Unicode codecs, available for
transcoding of text at the Java level. These also are exposed through the _codecs
module. In CPython, the implementations are found in Objects/unicodeobject.c.
| Modifier and Type | Class and Description |
|---|---|
| public static class | |
| private static class | |
| pack-priv static enum | codecs.
Enumeration of the error causes during decoding of the Base64 segment of UTF-7 |
| Modifier and Type | Field and Description |
|---|---|
| private static final String | B64_CHARS
Look-up for the Base64 encoded byte [0..0x3f] |
| public static final String | |
| private static final byte[] | BASE64_VALUE
Look-up table to convert ASCII byte to 6-bit Base64 value, -1 if not Base64, and -2 if special terminator '-'. |
| private static char[] | |
| pack-priv static char[] | |
| public static final String | |
| private static char | |
| public static final String | |
| private static final byte[] | |
| private static byte[] | |
| public static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static StringBuilder | |
| public static PyObject | |
| private static void | |
| public static int | Returns: absolute resume position.of byte buffer being decoded size, PyObject returned from error handler errorTuple)Given the return from some codec error handler (invoked while encoding or decoding), which specifies a resume position, and the length of the input being encoded or decoded, check and interpret the resume position. |
| private static void | checkErrorHandlerReturn(String
name of the error policy errors, PyObject from error handler replacementSpec)Check thet the error handler returned a tuple
|
| public static PyObject | |
| public static PyObject | Returns: must be a tuple(replacement_unicode, resume_index)name of the error policy (or null meaning "strict") errors, String name of encoding that encountered the error encoding, String bytes being decoded toDecode, int index of first byte it couldn't decode start, int index+1 of last byte it couldn't decode (usually becomes the resume point) end, String contribution to error message if any reason)Invoke a user-defined error-handling mechanism, for errors encountered during decoding, as
registered through |
| private static int | Returns: the number of bits (<6) not emittedoutput byte array v, long holding the bits buffer, int the number of bits held (<=64) n)Helper for |
| private static void | emitBase64Padded(StringBuilder
output byte array v, long holding the bits buffer, int the number of bits held (<=60) n)Helper for |
| private static int | Returns: the number of bits not emitted (<32 unless error)output UTF-16 sequence v, long holding the bits buffer, int the number of bits held (<=64) n)Helper for |
| private static codecs. | Returns: the diagnosisholding the bits buffer, int the number of bits held (<=64) n)Helper for |
| public static String | |
| private static boolean | Returns: true if c should be encoded as itselfcode point of the character c, boolean true if characters in "set O" may be encoded as themselves directO, boolean true if whitespace characters may be encoded as themselves directWS)Determine whether, in the UTF-7 encoder, this character should be encoded as itself. |
| public static PyObject | Returns: must be a tuple(replacement_unicode, resume_index)name of the error policy (or null meaning "strict") errors, String name of encoding that encountered the error encoding, String unicode string being encoded toEncode, int index of first char it couldn't encode start, int index+1 of last char it couldn't encode (usually becomes the resume point) end, String contribution to error message if any reason)Invoke a user-defined error-handling mechanism, for errors encountered during encoding, as
registered through |
| private static int | |
| public static String | |
| public static PyObject | |
| public static int | Returns: the resume position: index of next byte to decodeoutput buffer of unicode (as UTF-16) that the codec is building partialDecode, String name of the error policy (or null meaning "strict") errors, String name of encoding that encountered the error encoding, String bytes being decoded toDecode, int index of first byte it couldn't decode start, int index+1 of last byte it couldn't decode (usually becomes the resume point) end, String contribution to error message if any reason)Handler for errors encountered during decoding, adjusting the output buffer contents and returning the correct position to resume decoding (if the handler does not simply raise an exception). |
| private static boolean | |
| public static PyTuple | |
| public static PyObject | |
| private static String | |
| public static String | |
| public static PyUnicode | |
| private static String | |
| public static String | |
| public static PyUnicode | |
| public static String | |
| public static String | Returns: unicode result (as UTF-16 Java String)input represented as String (Jython PyString convention) bytes, String error policy name (e.g. "ignore", "replace") errors)Decode completely a sequence of bytes representing the UTF-7 encoded form of a Unicode string and return the (Jython internal representation of) the unicode object. |
| public static String | Returns: unicode result (as UTF-16 Java String)input represented as String (Jython PyString convention) bytes, String error policy name (e.g. "ignore", "replace") errors, int[] returns number of bytes consumed in element 0, or is null if a "final" call consumed)Decode (perhaps partially) a sequence of bytes representing the UTF-7 encoded form of a Unicode string and return the (Jython internal representation of) the unicode object, and amount of input consumed. |
| public static String | |
| public static String | |
| public static String | |
| public static String | |
| private static String | |
| public static String | |
| public static String | |
| public static String | |
| public static String | Returns: bytes representing the encoded unicode stringto be encoded unicode, boolean true if characters in "set O" should be translated to base64 base64SetO, boolean true if white-space characters should be translated to base64 base64WhiteSpace, String error policy name (e.g. "ignore", "replace") errors)Encode a UTF-16 Java String as UTF-7 bytes represented by the low bytes of the characters in a String. |
| public static String | |
| public static void | |
| public static void | |
| public static PyObject | |
| public static void | |
| public static PyObject | |
| private static char | |
| private static PyUnicode | |
| private static PyException | |
| public static StringBuilder | |
| public static PyObject | |
| private static void |