EXT. Nim's codec. not the same as Python's codec
Types
EncErrors {.pure.} = enum strict, ## - raise a ValueError error (or a subclass) ignore, ## - ignore the character and continue with the next replace, ## - replace with a suitable replacement character; ## Python will use the official U+FFFD REPLACEMENT ## CHARACTER for the builtin Unicode codecs on ## decoding and "?" on encoding. surrogateescape, ## - replace with private code points U+DCnn. xmlcharrefreplace, ## - Replace with the appropriate XML ## character reference (only for encoding). backslashreplace, ## - Replace with backslashed escape sequences. namereplace ## - Replace with \N{...} escape sequences ## (only for encoding).
- Source Edit
NCodecInfo = object name*: string errors*: string encode*, decode*: EncoderCvt close*: EncoderClose
- Source Edit
Procs
func initNCodecInfo(encoding: string; errors = DefErrors): NCodecInfo {. ...raises: [LookupError], tags: [], forbids: [].}
- Source Edit