codecs (Jython API documentation)
Date: 2012-08-13

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.python.core
Class codecs

    java.lang.Object
      org.python.core.codecs

    public class codecs

extends Object

Contains the implementation of the builtin codecs.

Since:
  Jython 2.0

Field Summary
`static String` | `BACKSLASHREPLACE`
`static String` | `IGNORE`
`static String` | `REPLACE`
`static char[]` | `utf7_special`
`static String` | `XMLCHARREFREPLACE`

Constructor Summary
`codecs()`

Method Summary
`static PyObject` | `backslashreplace_errors(PyObject[] args, String[] kws)`
`static StringBuilder` | `backslashreplace(int start, int end, String toReplace)`
`static int` | `calcNewPosition(int size, PyObject errorTuple)`
`static PyObject` | `decode(PyString v, String encoding, String errors)`
`static PyObject` | `decoding_error(String errors, String encoding, String toEncode, int start, int end, String reason)`
`static String` | `encode(PyString v, String encoding, String errors)`
`static PyObject` | `encoding_error(String errors, String encoding, String toEncode, int start, int end, String reason)`
`static String` | `getDefaultEncoding()`
`static PyObject` | `ignore_errors(PyObject[] args, String[] kws)`
`static int` | `insertReplacementAndGetResume(StringBuilder partialDecode, String errors, String encoding, String toDecode, int start, int end, String reason)`
`static PyObject` | `lookup_error(String handlerName)`
`static PyTuple` | `lookup(String encoding)`
`static String` | `PyUnicode_DecodeASCII(String str, int size, String errors)`
`static PyUnicode` | `PyUnicode_DecodeIDNA(String input, String errors)`
`static String` | `PyUnicode_DecodeLatin1(String str, int size, String errors)`
`static PyUnicode` | `PyUnicode_DecodePunycode(String input, String errors)`
`static String` | `PyUnicode_DecodeRawUnicodeEscape(String str, String errors)`
`static String` | `PyUnicode_DecodeUTF7(String str, String errors)`
`static String` | `PyUnicode_DecodeUTF8(String str, String errors)`
`static String` | `PyUnicode_DecodeUTF8Stateful(String str, String errors, int[] consumed)`
`static String` | `PyUnicode_EncodeASCII(String str, int size, String errors)`
`static String` | `PyUnicode_EncodeIDNA(PyUnicode input, String errors)`
`static String` | `PyUnicode_EncodeLatin1(String str, int size, String errors)`
`static String` | `PyUnicode_EncodePunycode(PyUnicode input, String errors)`
`static String` | `PyUnicode_EncodeRawUnicodeEscape(String str, String errors, boolean modifed)`
`static String` | `PyUnicode_EncodeUTF7(String str, boolean encodeSetO, boolean encodeWhiteSpace, String errors)`
`static String` | `PyUnicode_EncodeUTF8(String str, String errors)`
`static void` | `register_error(String name, PyObject error)`
`static void` | `register(PyObject search_function)`
`static PyObject` | `replace_errors(PyObject[] args, String[] kws)`
`static void` | `setDefaultEncoding(String encoding)`
`static PyObject` | `strict_errors(PyObject[] args, String[] kws)`
`static PyObject` | `xmlcharrefreplace_errors(PyObject[] args, String[] kws)`
`static StringBuilder` | `xmlcharrefreplace(int start, int end, String toReplace)`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### BACKSLASHREPLACE

    public static final String BACKSLASHREPLACE

See Also:
  Constant Field Values

### IGNORE

    public static final String IGNORE

See Also:
  Constant Field Values

### REPLACE

    public static final String REPLACE

See Also:
  Constant Field Values

### XMLCHARREFREPLACE

    public static final String XMLCHARREFREPLACE

See Also:
  Constant Field Values

### utf7_special

    public static char[] utf7_special

Constructor Detail

### codecs

    public codecs()

Method Detail

### getDefaultEncoding

    public static String getDefaultEncoding()

### setDefaultEncoding

    public static void setDefaultEncoding(String encoding)

### lookup_error

    public static PyObject lookup_error(String handlerName)

### register_error

    public static void register_error(String name,
                                      PyObject error)

### register

    public static void register(PyObject search_function)

### lookup

    public static PyTuple lookup(String encoding)

### decode

    public static PyObject decode(PyString v,
                                  String encoding,
                                  String errors)

### encode

    public static String encode(PyString v,
                                String encoding,
                                String errors)

### strict_errors

    public static PyObject strict_errors(PyObject[] args,
                                         String[] kws)

### ignore_errors

    public static PyObject ignore_errors(PyObject[] args,
                                         String[] kws)

### replace_errors

    public static PyObject replace_errors(PyObject[] args,
                                          String[] kws)

### xmlcharrefreplace_errors

    public static PyObject xmlcharrefreplace_errors(PyObject[] args,
                                                    String[] kws)

### xmlcharrefreplace

    public static StringBuilder xmlcharrefreplace(int start,
                                                  int end,
                                                  String toReplace)

### backslashreplace_errors

    public static PyObject backslashreplace_errors(PyObject[] args,
                                                   String[] kws)

### backslashreplace

    public static StringBuilder backslashreplace(int start,
                                                 int end,
                                                 String toReplace)

### PyUnicode_DecodeUTF7

    public static String PyUnicode_DecodeUTF7(String str,
                                              String errors)

### PyUnicode_EncodeUTF7

    public static String PyUnicode_EncodeUTF7(String str,
                                              boolean encodeSetO,
                                              boolean encodeWhiteSpace,
                                              String errors)

### PyUnicode_DecodeUTF8

    public static String PyUnicode_DecodeUTF8(String str,
                                              String errors)

### PyUnicode_DecodeUTF8Stateful

    public static String PyUnicode_DecodeUTF8Stateful(String str,
                                                      String errors,
                                                      int[] consumed)

### PyUnicode_EncodeUTF8

    public static String PyUnicode_EncodeUTF8(String str,
                                              String errors)

### PyUnicode_DecodeASCII

    public static String PyUnicode_DecodeASCII(String str,
                                               int size,
                                               String errors)

### PyUnicode_DecodeLatin1

    public static String PyUnicode_DecodeLatin1(String str,
                                                int size,
                                                String errors)

### PyUnicode_EncodeASCII

    public static String PyUnicode_EncodeASCII(String str,
                                               int size,
                                               String errors)

### PyUnicode_EncodeLatin1

    public static String PyUnicode_EncodeLatin1(String str,
                                                int size,
                                                String errors)

### calcNewPosition

    public static int calcNewPosition(int size,
                                      PyObject errorTuple)

### PyUnicode_EncodeRawUnicodeEscape

    public static String PyUnicode_EncodeRawUnicodeEscape(String str,
                                                          String errors,
                                                          boolean modifed)

### PyUnicode_DecodeRawUnicodeEscape

    public static String PyUnicode_DecodeRawUnicodeEscape(String str,
                                                          String errors)

### PyUnicode_EncodePunycode

    public static String PyUnicode_EncodePunycode(PyUnicode input,
                                                  String errors)

### PyUnicode_DecodePunycode

    public static PyUnicode PyUnicode_DecodePunycode(String input,
                                                     String errors)

### PyUnicode_EncodeIDNA

    public static String PyUnicode_EncodeIDNA(PyUnicode input,
                                              String errors)

### PyUnicode_DecodeIDNA

    public static PyUnicode PyUnicode_DecodeIDNA(String input,
                                                 String errors)

### encoding_error

    public static PyObject encoding_error(String errors,
                                          String encoding,
                                          String toEncode,
                                          int start,
                                          int end,
                                          String reason)

### insertReplacementAndGetResume

    public static int insertReplacementAndGetResume(StringBuilder partialDecode,
                                                    String errors,
                                                    String encoding,
                                                    String toDecode,
                                                    int start,
                                                    int end,
                                                    String reason)

### decoding_error

    public static PyObject decoding_error(String errors,
                                          String encoding,
                                          String toEncode,
                                          int start,
                                          int end,
                                          String reason)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Jython homepage