Functions | |
void | StrBufUrlescAppend (StrBuf *OutBuf, const StrBuf *In, const char *PlainIn) |
Escape a string for feeding out as a URL while appending it to a Buffer. | |
void | StrBufHexescAppend (StrBuf *OutBuf, const StrBuf *In, const char *PlainIn) |
append a string in hex encoding to the buffer | |
long | StrEscAppend (StrBuf *Target, const StrBuf *Source, const char *PlainIn, int nbsp, int nolinebreaks) |
Append a string, escaping characters which have meaning in HTML. | |
void | StrMsgEscAppend (StrBuf *Target, const StrBuf *Source, const char *PlainIn) |
Append a string, escaping characters which have meaning in HTML. Converts linebreaks into blanks; escapes single quotes. | |
void | StrIcalEscAppend (StrBuf *Target, const StrBuf *Source, const char *PlainIn) |
Append a string, escaping characters which have meaning in ICAL. [ ,]. | |
long | StrECMAEscAppend (StrBuf *Target, const StrBuf *Source, const char *PlainIn) |
Append a string, escaping characters which have meaning in JavaScript strings . | |
long | StrHtmlEcmaEscAppend (StrBuf *Target, const StrBuf *Source, const char *PlainIn, int nbsp, int nolinebreaks) |
Append a string, escaping characters which have meaning in HTML + json. | |
void | StrBufEUid_unescapize (StrBuf *target, const StrBuf *source) |
unhide special chars hidden to the HTML escaper | |
void | StrBufEUid_escapize (StrBuf *target, const StrBuf *source) |
hide special chars from the HTML escapers and friends | |
int | StrBufDecodeBase64 (StrBuf *Buf) |
decode a buffer from base 64 encoding; destroys original | |
int | StrBufDecodeHex (StrBuf *Buf) |
decode a buffer from base 64 encoding; destroys original | |
int | StrBufSanitizeAscii (StrBuf *Buf, const char Mute) |
replace all chars >0x20 && < 0x7F with Mute | |
long | StrBufUnescape (StrBuf *Buf, int StripBlanks) |
remove escaped strings from i.e. the url string (like 20 for blanks) | |
int | StrBufRFC2047encode (StrBuf **target, const StrBuf *source) |
RFC2047-encode a header field if necessary. If no non-ASCII characters are found, the string will be copied verbatim without encoding. | |
void | ctdl_iconv_open (const char *tocode, const char *fromcode, void *pic) |
Wrapper around iconv_open() Our version adds aliases for non-standard Microsoft charsets such as 'MS950', aliasing them to names like 'CP950'. | |
void | StrBufConvert (StrBuf *ConvertBuf, StrBuf *TmpBuf, void *pic) |
convert one buffer according to the preselected iconv pointer PIC | |
void | StrBuf_RFC822_to_Utf8 (StrBuf *Target, const StrBuf *DecodeMe, const StrBuf *DefaultCharset, StrBuf *FoundCharset) |
Handle subjects with RFC2047 encoding such as: =?koi8-r?B?78bP0s3Mxc7JxSDXz9rE1dvO2c3JINvB0sHNySDP?=. | |
int | CompressBuffer (StrBuf *Buf) |
compress the buffer with gzip Attention! If you feed this a Const String, you must maintain the uncompressed buffer yourself! |
these functions translate the content of a buffer into another representation; some are combined Fillers and encoders
int CompressBuffer | ( | StrBuf * | Buf | ) |
compress the buffer with gzip Attention! If you feed this a Const String, you must maintain the uncompressed buffer yourself!
Buf | buffer whose content is to be gzipped |
void ctdl_iconv_open | ( | const char * | tocode, | |
const char * | fromcode, | |||
void * | pic | |||
) |
Wrapper around iconv_open() Our version adds aliases for non-standard Microsoft charsets such as 'MS950', aliasing them to names like 'CP950'.
tocode | Target encoding | |
fromcode | Source encoding | |
pic | anonimized pointer to iconv struct |
void StrBuf_RFC822_to_Utf8 | ( | StrBuf * | Target, | |
const StrBuf * | DecodeMe, | |||
const StrBuf * | DefaultCharset, | |||
StrBuf * | FoundCharset | |||
) |
Handle subjects with RFC2047 encoding such as: =?koi8-r?B?78bP0s3Mxc7JxSDXz9rE1dvO2c3JINvB0sHNySDP?=.
Target | where to put the decoded string to | |
DecodeMe | buffer with encoded string | |
DefaultCharset | if we don't find one, which should we use? | |
FoundCharset | overrides DefaultCharset if non-empty; If we find a charset inside of the string, put it here for later use where no string might be known. |
convert one buffer according to the preselected iconv pointer PIC
ConvertBuf | buffer we need to translate | |
TmpBuf | To share a workbuffer over several iterations. prepare to have it filled with useless stuff afterwards. | |
pic | Pointer to the iconv-session Object |
int StrBufDecodeBase64 | ( | StrBuf * | Buf | ) |
decode a buffer from base 64 encoding; destroys original
Buf | Buffor to transform |
int StrBufDecodeHex | ( | StrBuf * | Buf | ) |
decode a buffer from base 64 encoding; destroys original
Buf | Buffor to transform |
hide special chars from the HTML escapers and friends
target | buffer to put the escaped string in | |
source | buffer to escape |
unhide special chars hidden to the HTML escaper
target | buffer to put the unescaped string in | |
source | buffer to unescape |
append a string in hex encoding to the buffer
OutBuf | the output buffer | |
In | Buffer to encode | |
PlainIn | way in from plain old c strings |
< we max append 3 chars at once plus the
< we max append 3 chars at once plus the
RFC2047-encode a header field if necessary. If no non-ASCII characters are found, the string will be copied verbatim without encoding.
target | Target buffer. | |
source | Source string to be encoded. |
int StrBufSanitizeAscii | ( | StrBuf * | Buf, | |
const char | Mute | |||
) |
replace all chars >0x20 && < 0x7F with Mute
Mute | char to put over invalid chars | |
Buf | Buffor to transform |
long StrBufUnescape | ( | StrBuf * | Buf, | |
int | StripBlanks | |||
) |
remove escaped strings from i.e. the url string (like 20 for blanks)
Buf | Buffer to translate | |
StripBlanks | Reduce several blanks to one? |
Escape a string for feeding out as a URL while appending it to a Buffer.
OutBuf | the output buffer | |
In | Buffer to encode | |
PlainIn | way in from plain old c strings |
< we max append 3 chars at once plus the
< we max append 3 chars at once plus the
Append a string, escaping characters which have meaning in JavaScript strings .
Target | target buffer | |
Source | source buffer; set to NULL if you just have a C-String | |
PlainIn | Plain-C string to append; set to NULL if unused |
long StrEscAppend | ( | StrBuf * | Target, | |
const StrBuf * | Source, | |||
const char * | PlainIn, | |||
int | nbsp, | |||
int | nolinebreaks | |||
) |
Append a string, escaping characters which have meaning in HTML.
Target | target buffer | |
Source | source buffer; set to NULL if you just have a C-String | |
PlainIn | Plain-C string to append; set to NULL if unused | |
nbsp | If nonzero, spaces are converted to non-breaking spaces. | |
nolinebreaks | if set to 1, linebreaks are removed from the string. if set to 2, linebreaks are replaced by <br/> |
long StrHtmlEcmaEscAppend | ( | StrBuf * | Target, | |
const StrBuf * | Source, | |||
const char * | PlainIn, | |||
int | nbsp, | |||
int | nolinebreaks | |||
) |
Append a string, escaping characters which have meaning in HTML + json.
Target | target buffer | |
Source | source buffer; set to NULL if you just have a C-String | |
PlainIn | Plain-C string to append; set to NULL if unused | |
nbsp | If nonzero, spaces are converted to non-breaking spaces. | |
nolinebreaks | if set to 1, linebreaks are removed from the string. if set to 2, linebreaks are replaced by <br/> |
Append a string, escaping characters which have meaning in ICAL. [
,].
Target | target buffer | |
Source | source buffer; set to NULL if you just have a C-String | |
PlainIn | Plain-C string to append; set to NULL if unused |
Append a string, escaping characters which have meaning in HTML. Converts linebreaks into blanks; escapes single quotes.
Target | target buffer | |
Source | source buffer; set to NULL if you just have a C-String | |
PlainIn | Plain-C string to append; set to NULL if unused |