GLib.strcompress
Description: Reference for GLib.strcompress

### Function

# GLibstrcompress

#### Declaration [src]

    gchar*
    g_strcompress (
      const gchar* source
    )

#### Description [src]

Makes a copy of a string replacing C string-style escape sequences with their one byte equivalent:

- `\b` → U+0008 Backspace
- `\f` → U+000C Form Feed
- `\n` → U+000A Line Feed
- `\r` → U+000D Carriage Return
- `\t` → U+0009 Horizontal Tabulation
- `\v` → U+000B Vertical Tabulation
- `\` followed by one to three octal digits → the numeric value (mod 255)
- `\` followed by any other character → the character as is. For example, `\\` will turn into a backslash (`\`) and `\"` into a double quote (`"`).

`g_strescape()` does the reverse conversion.

#### Parameters

`source`

  Type: `const gchar*`

  A string to compress.

  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

#### Return value

Type: `gchar*`

A newly-allocated copy of `source` with all escaped character compressed.

The caller of the function takes ownership of the data, and is responsible for freeing it.
The value is a NUL terminated UTF-8 string.