Module Headers.Normalize

Normalize specifies how to handle header values. It is used in two contexts:

1) Transport (Normalize.encode): Specify how to turn a string into a header value. `Whitespace will add the necessary for transport.

2) Processing (Normalize.decode): Specify how to turn a header value into a string. `Whitespace will remove all leading and trailing whitespace on each line in order to cleanly process the value.

Normalize specifies how to handle header values. It is used in two contexts:

1) Transport (Normalize.encode): Specify how to turn a string into a header value. `Whitespace will add the necessary for transport.

2) Processing (Normalize.decode): Specify how to turn a header value into a string. `Whitespace will remove all leading and trailing whitespace on each line in order to cleanly process the value.

type encode = [
  1. | `None
    (*

    Leave whitespace unchanged

    *)
  2. | `Whitespace
    (*

    Cleanup leading and trailing whitespace on each line

    *)
]
val sexp_of_encode : encode -> Sexplib0.Sexp.t
type decode = [
  1. | encode
  2. | `Whitespace_and_encoding of [ `Any_charset | `Only of [ `Ascii | `Big5 | `GB2312 | `Latin1 | `Latin2 | `Utf8 | `Windows1252 | `KS_C_5601_1987 ] list ] * [ `Pretend_all_charsets_are_same ]
    (*

    Will attempt to handle decoded words. `Any_charset will cause all known charsets to be handled. `Only charsets will restrict the parsing to only the given charsets. `Pretend_all_charsets_are_same will not actually do any charset conversion and just copies the raw bytes. For ascii-compatible encodings this often works well-enough, though you do end up with garbage for any characters not in the ascii-plane.

    *)
]
val sexp_of_decode : decode -> Sexplib0.Sexp.t
val default : [> `Whitespace ]