---
product: Chilkat
product_version: 11.7.0
language: wc
language_label: Unicode C
class: Gzip
license: bundle
deprecated: false
reference_html: https://www.chilkatsoft.com/refdoc/wc_CkGzipWRef.html
---
# Chilkat Gzip — Unicode C — v11.7.0

> Chilkat 11.7.0 · language=wc · class=Gzip
> Other versions: replace `11.7.0` in this URL. Other languages: `https://www.chilkatsoft.com/ai-docs/v/11.7.0/<lang>/classes/Gzip.md`.
> Language-wide rules (install, unlock, error model, strings/bytes): `https://www.chilkatsoft.com/ai-docs/v/11.7.0/wc/guide.md`.

## Purpose

**Compress, decompress, inspect, and convert GZIP data in files or memory.**

`Chilkat.Gzip` provides GZIP compression and decompression for file-based and in-memory workflows. It can compress and uncompress files, strings, byte arrays, `BinData`, and encoded data such as Base64 or hex. It also supports `.tar.gz` extraction, gzip metadata such as original filename, timestamp, and comments, and inspection of GZIP header information without fully expanding the compressed data.

**File compression**

Compress files to `.gz`, uncompress `.gz` files, and write decompressed output directly to disk.

**Memory-based data**

Work with byte arrays and `Chilkat.BinData` for applications that need compression or decompression without temporary files.

**String workflows**

Compress and uncompress strings with explicit charset handling for text data that must round-trip correctly.

**Encoded GZIP data**

Handle GZIP data represented as Base64, hex, or other supported encoded forms when binary data must be carried as text.

**GZIP metadata**

Set or inspect metadata such as original filename, modified time, comments, and extra data stored in the GZIP header.

**Tar-gzip and XFDL**

Extract `.tar.gz` archives and decode XFDL content that uses gzip-related encodings.

**Common pattern:** Use `Gzip` when the data is a single GZIP stream, a `.gz` file, or a `.tar.gz` archive. For ZIP archives, use `Chilkat.Zip`; for raw deflate or zlib-style compression, use `Chilkat.Compression`.

For an extended overview, see [Gzip Class Overview](https://www.chilkatsoft.com/gzip_overview.asp).

## Object creation, unlocking and error handling

**Create/Dispose**

```c
HCkGzipW instance = CkGzipW_Create();
// ...
CkGzipW_Dispose(instance);
```

`HCkGzipW CkGzipW_Create(void);`

Creates an instance of the HCkGzipW object and returns a handle ("void \*" pointer). The handle is passed in the 1st argument for the functions listed on this page.

`void CkGzipW_Dispose(HCkGzipW handle);`

Objects created by calling CkGzipW_Create must be freed by calling this method. A memory leak occurs if a handle is not disposed by calling this function. Also, any handle returned by a Chilkat "C" function must also be freed by the application by calling the appropriate Dispose method, such as CkGzipW_Dispose.

Call `Global.UnlockBundle` once at the start of the program, before using this or any other Chilkat class. Any string unlocks a fully functional 30-day trial; a purchased unlock code is used in production. See `guide.md` for the exact code in Unicode C.

## Members common to every Chilkat class

Documented once per language in `common-members.md`; listed here so this page is self-contained.

| Property | Signature | Access | Meaning |
|---|---|---|---|
| `DebugLogFilePath` | `void CkGzipW_getDebugLogFilePath(HCkGzipW cHandle, HCkString retval); void CkGzipW_putDebugLogFilePath(HCkGzipW cHandle, const wchar_t *newVal); const wchar_t *CkGzipW_debugLogFilePath(HCkGzipW cHandle);` | read/write | If set to a file path, this property logs the LastErrorText of each Chilkat method or property call to the specified file. |
| `LastErrorHtml` | `void CkGzipW_getLastErrorHtml(HCkGzipW cHandle, HCkString retval); const wchar_t *CkGzipW_lastErrorHtml(HCkGzipW cHandle);` | read-only | Provides HTML-formatted information about the last called method or property. |
| `LastErrorText` | `void CkGzipW_getLastErrorText(HCkGzipW cHandle, HCkString retval); const wchar_t *CkGzipW_lastErrorText(HCkGzipW cHandle);` | read-only | Provides plain text information about the last called method or property. |
| `LastErrorXml` | `void CkGzipW_getLastErrorXml(HCkGzipW cHandle, HCkString retval); const wchar_t *CkGzipW_lastErrorXml(HCkGzipW cHandle);` | read-only | Provides XML-formatted information about the last called method or property. |
| `LastMethodSuccess` | `BOOL CkGzipW_getLastMethodSuccess(HCkGzipW cHandle); void CkGzipW_putLastMethodSuccess(HCkGzipW cHandle, BOOL newVal);` | read/write | Indicates the success or failure of the most recent method call: `TRUE` means success, `FALSE` means failure. |
| `VerboseLogging` | `BOOL CkGzipW_getVerboseLogging(HCkGzipW cHandle); void CkGzipW_putVerboseLogging(HCkGzipW cHandle, BOOL newVal);` | read/write | If set to `TRUE`, then the contents of LastErrorText (or LastErrorXml, or LastErrorHtml) may contain more verbose information. |
| `Version` | `void CkGzipW_getVersion(HCkGzipW cHandle, HCkString retval); const wchar_t *CkGzipW_version(HCkGzipW cHandle);` | read-only | Version of the component/library, such as "10.1.0" |

## Member index

| Member | Kind | Signature |
|---|---|---|
| `AbortCurrent` | property, read/write | `BOOL CkGzipW_getAbortCurrent(HCkGzipW cHandle); void CkGzipW_putAbortCurrent(HCkGzipW cHandle, BOOL newVal);` |
| `Comment` | property, read/write | `void CkGzipW_getComment(HCkGzipW cHandle, HCkString retval); void CkGzipW_putComment(HCkGzipW cHandle, const wchar_t *newVal); const wchar_t *CkGzipW_comment(HCkGzipW cHandle);` |
| `CompressionLevel` | property, read/write | `int CkGzipW_getCompressionLevel(HCkGzipW cHandle); void CkGzipW_putCompressionLevel(HCkGzipW cHandle, int newVal);` |
| `Filename` | property, read/write | `void CkGzipW_getFilename(HCkGzipW cHandle, HCkString retval); void CkGzipW_putFilename(HCkGzipW cHandle, const wchar_t *newVal); const wchar_t *CkGzipW_filename(HCkGzipW cHandle);` |
| `HeartbeatMs` | property, read/write | `int CkGzipW_getHeartbeatMs(HCkGzipW cHandle); void CkGzipW_putHeartbeatMs(HCkGzipW cHandle, int newVal);` |
| `LastModStr` | property, read/write | `void CkGzipW_getLastModStr(HCkGzipW cHandle, HCkString retval); void CkGzipW_putLastModStr(HCkGzipW cHandle, const wchar_t *newVal); const wchar_t *CkGzipW_lastModStr(HCkGzipW cHandle);` |
| `UseCurrentDate` | property, read/write | `BOOL CkGzipW_getUseCurrentDate(HCkGzipW cHandle); void CkGzipW_putUseCurrentDate(HCkGzipW cHandle, BOOL newVal);` |
| `CompressBd` | method | `BOOL CkGzipW_CompressBd(HCkGzipW cHandle, HCkBinDataW binDat);` |
| `CompressFile` | method | `BOOL CkGzipW_CompressFile(HCkGzipW cHandle, const wchar_t *srcPath, const wchar_t *destPath);` |
| `CompressFile2` | method | `BOOL CkGzipW_CompressFile2(HCkGzipW cHandle, const wchar_t *srcPath, const wchar_t *embeddedFilename, const wchar_t *destPath);` |
| `CompressFileBd` | method | `BOOL CkGzipW_CompressFileBd(HCkGzipW cHandle, const wchar_t *filePath, HCkBinDataW bd);` |
| `CompressSb` | method | `BOOL CkGzipW_CompressSb(HCkGzipW cHandle, HCkStringBuilderW sb, const wchar_t *charset, HCkBinDataW bd);` |
| `CompressStringENC` | method | `BOOL CkGzipW_CompressStringENC(HCkGzipW cHandle, const wchar_t *inStr, const wchar_t *charset, const wchar_t *encoding, const wchar_t *outStr); const wchar_t *CkGzipW_compressStringENC(HCkGzipW cHandle, const wchar_t *inStr, const wchar_t *charset, const wchar_t *encoding);` |
| `CompressStringToFile` | method | `BOOL CkGzipW_CompressStringToFile(HCkGzipW cHandle, const wchar_t *inStr, const wchar_t *destCharset, const wchar_t *destPath);` |
| `GetGzipInfo` | method | `BOOL CkGzipW_GetGzipInfo(HCkGzipW cHandle, const wchar_t *filePath, HCkJsonObjectW json);` |
| `GetGzipInfoBd` | method | `BOOL CkGzipW_GetGzipInfoBd(HCkGzipW cHandle, HCkBinDataW bd, HCkJsonObjectW json);` |
| `IsGzip` | method | `BOOL CkGzipW_IsGzip(HCkGzipW cHandle, HCkBinDataW bd);` |
| `LoadTaskCaller` | method | `BOOL CkGzipW_LoadTaskCaller(HCkGzipW cHandle, HCkTaskW task);` |
| `SetDt` | method | `BOOL CkGzipW_SetDt(HCkGzipW cHandle, HCkDateTimeW dt);` |
| `SetExtraData` | method | `BOOL CkGzipW_SetExtraData(HCkGzipW cHandle, const wchar_t *encodedData, const wchar_t *encoding);` |
| `UncompressBd` | method | `BOOL CkGzipW_UncompressBd(HCkGzipW cHandle, HCkBinDataW binDat);` |
| `UncompressBdToFile` | method | `BOOL CkGzipW_UncompressBdToFile(HCkGzipW cHandle, HCkBinDataW bd, const wchar_t *filePath);` |
| `UncompressFile` | method | `BOOL CkGzipW_UncompressFile(HCkGzipW cHandle, const wchar_t *srcPath, const wchar_t *destPath);` |
| `UncompressFileToString` | method | `BOOL CkGzipW_UncompressFileToString(HCkGzipW cHandle, const wchar_t *srcPath, const wchar_t *charset, const wchar_t *outStr); const wchar_t *CkGzipW_uncompressFileToString(HCkGzipW cHandle, const wchar_t *srcPath, const wchar_t *charset);` |
| `UncompressStringENC` | method | `BOOL CkGzipW_UncompressStringENC(HCkGzipW cHandle, const wchar_t *inStr, const wchar_t *charset, const wchar_t *encoding, const wchar_t *outStr); const wchar_t *CkGzipW_uncompressStringENC(HCkGzipW cHandle, const wchar_t *inStr, const wchar_t *charset, const wchar_t *encoding);` |
| `UnTarGz` | method | `BOOL CkGzipW_UnTarGz(HCkGzipW cHandle, const wchar_t *gzPath, const wchar_t *destDir, BOOL bNoAbsolute);` |
| `XfdlToXml` | method | `BOOL CkGzipW_XfdlToXml(HCkGzipW cHandle, const wchar_t *xfldData, const wchar_t *outStr); const wchar_t *CkGzipW_xfdlToXml(HCkGzipW cHandle, const wchar_t *xfldData);` |

Deprecated members are listed at the end of this file with their replacements; do not use them in new code.

## Properties

### Gzip.AbortCurrent

`Chilkat 11.7.0 · wc · Gzip · AbortCurrent · property · read/write · since 9.5.0.58`

```c
BOOL CkGzipW_getAbortCurrent(HCkGzipW cHandle);
void CkGzipW_putAbortCurrent(HCkGzipW cHandle, BOOL newVal);
```

Set this property to `TRUE` to request that the currently running operation be aborted. This is useful for long-running operations such as large file compression or decompression. Methods that complete quickly are generally not affected.

If no method is currently running, the property is automatically reset to `FALSE` when the next method begins. After an abort occurs, it is also reset to `FALSE`. Both synchronous and asynchronous operations can be aborted. For synchronous calls, another thread must set this property.

### Gzip.Comment

`Chilkat 11.7.0 · wc · Gzip · Comment · property · read/write`

```c
void CkGzipW_getComment(HCkGzipW cHandle, HCkString retval);
void CkGzipW_putComment(HCkGzipW cHandle, const wchar_t *newVal);
const wchar_t *CkGzipW_comment(HCkGzipW cHandle);
```

An optional comment to embed in the Gzip file when a `Compress*` method is called.

### Gzip.CompressionLevel

`Chilkat 11.7.0 · wc · Gzip · CompressionLevel · property · read/write · since 9.5.0.50`

```c
int CkGzipW_getCompressionLevel(HCkGzipW cHandle);
void CkGzipW_putCompressionLevel(HCkGzipW cHandle, int newVal);
```

Controls the compression level used when creating Gzip data. The value can range from `0` to `9`.

- `0` = no compression
- `9` = maximum compression

The default value is `6`, which is a typical balance between compression size and speed. Higher levels may take significantly more CPU time while producing only slightly smaller output, depending on the data.

### Gzip.Filename

`Chilkat 11.7.0 · wc · Gzip · Filename · property · read/write`

```c
void CkGzipW_getFilename(HCkGzipW cHandle, HCkString retval);
void CkGzipW_putFilename(HCkGzipW cHandle, const wchar_t *newVal);
const wchar_t *CkGzipW_filename(HCkGzipW cHandle);
```

The filename to embed in the Gzip file when a `Compress*` method is called. Some Gzip extraction tools use this embedded filename as the default output filename.

### Gzip.HeartbeatMs

`Chilkat 11.7.0 · wc · Gzip · HeartbeatMs · property · read/write`

```c
int CkGzipW_getHeartbeatMs(HCkGzipW cHandle);
void CkGzipW_putHeartbeatMs(HCkGzipW cHandle, int newVal);
```

**Full documentation for this property (same in every language):** [Event Callback Examples](https://www.chilkatsoft.com/ai-docs/v/11.7.0/articles/event_callback_examples.md)

Specifies the interval, in milliseconds, between `AbortCheck` event callbacks. These callbacks allow an application to cancel certain long-running operations before they finish.

The default value is `0`, which means no `AbortCheck` callbacks are triggered.

### Gzip.LastModStr

`Chilkat 11.7.0 · wc · Gzip · LastModStr · property · read/write`

```c
void CkGzipW_getLastModStr(HCkGzipW cHandle, HCkString retval);
void CkGzipW_putLastModStr(HCkGzipW cHandle, const wchar_t *newVal);
const wchar_t *CkGzipW_lastModStr(HCkGzipW cHandle);
```

Specifies the last-modified date/time to embed in the Gzip file when a `Compress*` method is called.

The value must be provided as an RFC 822 formatted date/time string.

**Example:**

```
Sun, 12 Apr 2026 12:45:26 GMT
```

If this property is not set, the current system date/time is used automatically.

### Gzip.UseCurrentDate

`Chilkat 11.7.0 · wc · Gzip · UseCurrentDate · property · read/write`

```c
BOOL CkGzipW_getUseCurrentDate(HCkGzipW cHandle);
void CkGzipW_putUseCurrentDate(HCkGzipW cHandle, BOOL newVal);
```

Controls the last-modified date/time assigned to files created by `Uncompress*` methods.

When set to `TRUE`, the extracted file uses the current date/time instead of the date/time stored in the Gzip data.

## Methods

### Gzip.CompressBd

`Chilkat 11.7.0 · wc · Gzip · CompressBd · method · since 9.5.0.67`

```c
BOOL CkGzipW_CompressBd(HCkGzipW cHandle, HCkBinDataW binDat);
```

Compresses the contents of a `BinData` object in place, replacing the original data with Gzip-compressed data.

Returns TRUE for success, FALSE for failure.

Async variant: `CompressBdAsync` — same arguments, returns a `Task` (see Async variants below).

### Gzip.CompressFile

`Chilkat 11.7.0 · wc · Gzip · CompressFile · method`

```c
BOOL CkGzipW_CompressFile(HCkGzipW cHandle, const wchar_t *srcPath, const wchar_t *destPath);
```

Compresses a file and writes the result as a Gzip file, typically with a `.gz` extension.

Returns TRUE for success, FALSE for failure.

Async variant: `CompressFileAsync` — same arguments, returns a `Task` (see Async variants below).

### Gzip.CompressFile2

`Chilkat 11.7.0 · wc · Gzip · CompressFile2 · method`

```c
BOOL CkGzipW_CompressFile2(HCkGzipW cHandle, const wchar_t *srcPath, const wchar_t *embeddedFilename, const wchar_t *destPath);
```

Compresses a file and writes the result as a Gzip file, while allowing a different filename to be embedded inside the Gzip data.

The `inFilename` parameter is the actual file on disk. The `srcPath` parameter is the filename stored in the Gzip header and may be used by extraction tools as the output filename.

Returns TRUE for success, FALSE for failure.

Async variant: `CompressFile2Async` — same arguments, returns a `Task` (see Async variants below).

### Gzip.CompressFileBd

`Chilkat 11.7.0 · wc · Gzip · CompressFileBd · method · since 11.0.0`

```c
BOOL CkGzipW_CompressFileBd(HCkGzipW cHandle, const wchar_t *filePath, HCkBinDataW bd);
```

Compresses a file and stores the resulting Gzip data in a `BinData` object.

The compressed output is held in memory. The maximum compressed size is 4 GB.

Returns TRUE for success, FALSE for failure.

Async variant: `CompressFileBdAsync` — same arguments, returns a `Task` (see Async variants below).

### Gzip.CompressSb

`Chilkat 11.7.0 · wc · Gzip · CompressSb · method · since 11.0.0`

```c
BOOL CkGzipW_CompressSb(HCkGzipW cHandle, HCkStringBuilderW sb, const wchar_t *charset, HCkBinDataW bd);
```

Compresses the text contained in a `StringBuilder` and writes the Gzip-compressed result to a `BinData` object.

Before compression, the string is converted to bytes using the specified character set, such as `utf-8`, `iso-8859-1`, or `shift_JIS`.

Returns TRUE for success, FALSE for failure.

Async variant: `CompressSbAsync` — same arguments, returns a `Task` (see Async variants below).

### Gzip.CompressStringENC

`Chilkat 11.7.0 · wc · Gzip · CompressStringENC · method`

```c
BOOL CkGzipW_CompressStringENC(HCkGzipW cHandle, const wchar_t *inStr, const wchar_t *charset, const wchar_t *encoding, const wchar_t *outStr);
const wchar_t *CkGzipW_compressStringENC(HCkGzipW cHandle, const wchar_t *inStr, const wchar_t *charset, const wchar_t *encoding);
```

**Full documentation for this method (same in every language):** [Binary Encodings Supported by Chilkat](https://www.chilkatsoft.com/ai-docs/v/11.7.0/articles/binary_encodings.md)

Compresses a string and returns the Gzip-compressed data as an encoded string.

The input string is first converted to bytes using the specified character set. The compressed binary data is then encoded using the requested encoding, such as `base64`, `hex`, `url`, `base32`, or quoted-printable.

Returns TRUE for success, FALSE for failure.

### Gzip.CompressStringToFile

`Chilkat 11.7.0 · wc · Gzip · CompressStringToFile · method`

```c
BOOL CkGzipW_CompressStringToFile(HCkGzipW cHandle, const wchar_t *inStr, const wchar_t *destCharset, const wchar_t *destPath);
```

**Full documentation for this method (same in every language):** [Full List of Charset Names](https://www.chilkatsoft.com/ai-docs/v/11.7.0/articles/charsets_supported_by_chilkat.md)

Compresses a string and writes the resulting Gzip data to a file.

The string is first converted to bytes using the character set specified by `destCharset`.

Returns TRUE for success, FALSE for failure.

Async variant: `CompressStringToFileAsync` — same arguments, returns a `Task` (see Async variants below).

### Gzip.GetGzipInfo

`Chilkat 11.7.0 · wc · Gzip · GetGzipInfo · method · since 11.5.0`

```c
BOOL CkGzipW_GetGzipInfo(HCkGzipW cHandle, const wchar_t *filePath, HCkJsonObjectW json);
```

Retrieves metadata stored in a Gzip file and returns the information in a `JsonObject`.

The metadata is returned using the following JSON structure:

```
{
  "extraData": "AAECAw==",
  "filename": "example.txt",
  "comment": "This is the comment"
}
```

- **filename** – the original filename embedded in the Gzip file (if present)
- **comment** – an optional descriptive comment (if present)
- **extraData** – optional additional binary data, returned as a Base64-encoded string

Any of these fields may be omitted if they were not included when the Gzip file was created.

Returns TRUE for success, FALSE for failure.

### Gzip.GetGzipInfoBd

`Chilkat 11.7.0 · wc · Gzip · GetGzipInfoBd · method · since 11.5.0`

```c
BOOL CkGzipW_GetGzipInfoBd(HCkGzipW cHandle, HCkBinDataW bd, HCkJsonObjectW json);
```

Retrieves metadata stored in Gzip data contained within a `BinData` object and returns the information in a `JsonObject`.

The metadata is returned using the same JSON structure:

```
{
  "extraData": "AAECAw==",
  "filename": "example.txt",
  "comment": "This is the comment"
}
```

- **filename** – the original filename embedded in the Gzip data (if present)
- **comment** – an optional descriptive comment (if present)
- **extraData** – optional additional binary data, returned as a Base64-encoded string

Any of these fields may be omitted if they were not included when the Gzip data was created.

Returns TRUE for success, FALSE for failure.

### Gzip.IsGzip

`Chilkat 11.7.0 · wc · Gzip · IsGzip · method · since 11.0.0`

```c
BOOL CkGzipW_IsGzip(HCkGzipW cHandle, HCkBinDataW bd);
```

Checks whether the data contained in a `BinData` object is in Gzip format.

Returns `TRUE` if the data is Gzip-formatted, or `FALSE` otherwise.

### Gzip.LoadTaskCaller

`Chilkat 11.7.0 · wc · Gzip · LoadTaskCaller · method · since 9.5.0.80`

```c
BOOL CkGzipW_LoadTaskCaller(HCkGzipW cHandle, HCkTaskW task);
```

Loads the caller of the task's async method.

Returns TRUE for success, FALSE for failure.

### Gzip.SetDt

`Chilkat 11.7.0 · wc · Gzip · SetDt · method`

```c
BOOL CkGzipW_SetDt(HCkGzipW cHandle, HCkDateTimeW dt);
```

Sets the last-modified date/time to embed in the Gzip file when a `Compress*` method is called.

If no date/time is explicitly set, the current system date/time is used.

Returns TRUE for success, FALSE for failure.

### Gzip.SetExtraData

`Chilkat 11.7.0 · wc · Gzip · SetExtraData · method · since 11.0.0`

```c
BOOL CkGzipW_SetExtraData(HCkGzipW cHandle, const wchar_t *encodedData, const wchar_t *encoding);
```

**Full documentation for this method (same in every language):** [Binary Encodings Supported by Chilkat](https://www.chilkatsoft.com/ai-docs/v/11.7.0/articles/binary_encodings.md)

Sets optional extra binary data to include in the Gzip header when a `Compress*` method is called.

The data is passed as an encoded string. Supported encodings include `base64`, `hex`, `ascii`, and many others.

Returns TRUE for success, FALSE for failure.

### Gzip.UncompressBd

`Chilkat 11.7.0 · wc · Gzip · UncompressBd · method · since 9.5.0.67`

```c
BOOL CkGzipW_UncompressBd(HCkGzipW cHandle, HCkBinDataW binDat);
```

Decompresses Gzip data contained in a `BinData` object in place, replacing the compressed data with the uncompressed data.

Returns TRUE for success, FALSE for failure.

Async variant: `UncompressBdAsync` — same arguments, returns a `Task` (see Async variants below).

### Gzip.UncompressBdToFile

`Chilkat 11.7.0 · wc · Gzip · UncompressBdToFile · method · since 11.0.0`

```c
BOOL CkGzipW_UncompressBdToFile(HCkGzipW cHandle, HCkBinDataW bd, const wchar_t *filePath);
```

Decompresses Gzip data stored in a `BinData` object and writes the result to a file.

Returns TRUE for success, FALSE for failure.

Async variant: `UncompressBdToFileAsync` — same arguments, returns a `Task` (see Async variants below).

### Gzip.UncompressFile

`Chilkat 11.7.0 · wc · Gzip · UncompressFile · method`

```c
BOOL CkGzipW_UncompressFile(HCkGzipW cHandle, const wchar_t *srcPath, const wchar_t *destPath);
```

Decompresses a Gzip file and writes the result to the specified output path.

The output filename is provided by the caller. The filename embedded in the Gzip data is not used.

Returns TRUE for success, FALSE for failure.

Async variant: `UncompressFileAsync` — same arguments, returns a `Task` (see Async variants below).

### Gzip.UncompressFileToString

`Chilkat 11.7.0 · wc · Gzip · UncompressFileToString · method`

```c
BOOL CkGzipW_UncompressFileToString(HCkGzipW cHandle, const wchar_t *srcPath, const wchar_t *charset, const wchar_t *outStr);
const wchar_t *CkGzipW_uncompressFileToString(HCkGzipW cHandle, const wchar_t *srcPath, const wchar_t *charset);
```

**Full documentation for this method (same in every language):** [List of Valid Charsets](https://www.chilkatsoft.com/ai-docs/v/11.7.0/articles/charsets_supported_by_chilkat.md)

Decompresses a Gzip file that contains text and returns the uncompressed text as a string.

The `charset` parameter specifies the character encoding of the uncompressed text, such as `utf-8`, `iso-8859-1`, `windows-1252`, `shift_JIS`, `big5`, etc.

Returns TRUE for success, FALSE for failure.

Async variant: `UncompressFileToStringAsync` — same arguments, returns a `Task` (see Async variants below).

### Gzip.UncompressStringENC

`Chilkat 11.7.0 · wc · Gzip · UncompressStringENC · method`

```c
BOOL CkGzipW_UncompressStringENC(HCkGzipW cHandle, const wchar_t *inStr, const wchar_t *charset, const wchar_t *encoding, const wchar_t *outStr);
const wchar_t *CkGzipW_uncompressStringENC(HCkGzipW cHandle, const wchar_t *inStr, const wchar_t *charset, const wchar_t *encoding);
```

**Full documentation for this method (same in every language):** [Binary Encodings Supported by Chilkat](https://www.chilkatsoft.com/ai-docs/v/11.7.0/articles/binary_encodings.md)

Decompresses Gzip data provided as an encoded string and returns the uncompressed result as text.

The input string is first decoded using the specified encoding, such as `base64`, `hex`, `url`, `base32`, quoted-printable, etc. The decoded Gzip data is then decompressed and converted to text using the specified character set.

Returns TRUE for success, FALSE for failure.

### Gzip.UnTarGz

`Chilkat 11.7.0 · wc · Gzip · UnTarGz · method`

```c
BOOL CkGzipW_UnTarGz(HCkGzipW cHandle, const wchar_t *gzPath, const wchar_t *destDir, BOOL bNoAbsolute);
```

Extracts a `.tar.gz` archive to a directory.

The Gzip decompression and TAR extraction are performed in streaming mode. No temporary files are created, and memory usage remains small and constant.

If `bNoAbsolute` is `TRUE`, absolute paths in the TAR archive are not allowed. This helps protect against extracting files to unsafe locations, such as system directories.

Returns TRUE for success, FALSE for failure.

Async variant: `UnTarGzAsync` — same arguments, returns a `Task` (see Async variants below).

### Gzip.XfdlToXml

`Chilkat 11.7.0 · wc · Gzip · XfdlToXml · method`

```c
BOOL CkGzipW_XfdlToXml(HCkGzipW cHandle, const wchar_t *xfldData, const wchar_t *outStr);
const wchar_t *CkGzipW_xfdlToXml(HCkGzipW cHandle, const wchar_t *xfldData);
```

**Full documentation for this method (same in every language):** [More about XFDL](https://www.chilkatsoft.com/ai-docs/v/11.7.0/articles/xfdl.md)

Converts encoded and compressed XFDL data to a decompressed XML string.

XFDL data is often stored in an ASCII-safe compressed form, such as `asci-gzip` or `asc-gzip`. Despite the name, this does not always mean the data is a standard `.gz` file. In some XFDL files, the compressed payload uses the raw deflate format rather than the full Gzip file format.

Chilkat automatically detects the actual encoding and compression format used by the XFDL data. It decodes the ASCII/Base64 representation, determines whether the compressed data is Gzip or deflate, decompresses it correctly, and returns the resulting XML string.

This allows applications to call `XfdlToXml` without needing to manually distinguish between XFDL variants such as Base64+Gzip and Base64+Deflate.

Returns the decoded and decompressed XML string.

**XFDL (Extensible Forms Description Language)** is an XML-based format used to define secure, interactive electronic forms—often including digital signatures and integrity protections—commonly used in government and enterprise applications.

Returns TRUE for success, FALSE for failure.

## Events and callbacks

This binding delivers progress information through callbacks (AbortCheck, PercentDone, ProgressInfo, TaskCompleted) rather than events. See `guide.md` for how to attach them in Unicode C.

## Async variants

Each returns a `Task` instead of the result and takes the same arguments as the synchronous method; run the task, wait for `Finished`, then read the result from the task. No new Async methods are added from 11.7.0 on.

```c
HCkTaskW CkGzipW_CompressBdAsync(HCkGzipW cHandle, HCkBinDataW binDat);
HCkTaskW CkGzipW_CompressFileAsync(HCkGzipW cHandle, const wchar_t *srcPath, const wchar_t *destPath);
HCkTaskW CkGzipW_CompressFile2Async(HCkGzipW cHandle, const wchar_t *srcPath, const wchar_t *embeddedFilename, const wchar_t *destPath);
HCkTaskW CkGzipW_CompressFileBdAsync(HCkGzipW cHandle, const wchar_t *filePath, HCkBinDataW bd);
HCkTaskW CkGzipW_CompressSbAsync(HCkGzipW cHandle, HCkStringBuilderW sb, const wchar_t *charset, HCkBinDataW bd);
HCkTaskW CkGzipW_CompressStringToFileAsync(HCkGzipW cHandle, const wchar_t *inStr, const wchar_t *destCharset, const wchar_t *destPath);
HCkTaskW CkGzipW_UncompressBdAsync(HCkGzipW cHandle, HCkBinDataW binDat);
HCkTaskW CkGzipW_UncompressBdToFileAsync(HCkGzipW cHandle, HCkBinDataW bd, const wchar_t *filePath);
HCkTaskW CkGzipW_UncompressFileAsync(HCkGzipW cHandle, const wchar_t *srcPath, const wchar_t *destPath);
HCkTaskW CkGzipW_UncompressFileToStringAsync(HCkGzipW cHandle, const wchar_t *srcPath, const wchar_t *charset);
HCkTaskW CkGzipW_UnTarGzAsync(HCkGzipW cHandle, const wchar_t *gzPath, const wchar_t *destDir, BOOL bNoAbsolute);
```

## Deprecated members — do not use in new code

| Member | Kind | Deprecated in | Use instead |
|---|---|---|---|
| `CompressFileToMem` | method | before 11.6.1 | — |
| `CompressMemory` | method | before 11.6.1 | — |
| `CompressMemToFile` | method | before 11.6.1 | — |
| `CompressString` | method | before 11.6.1 | — |
| `Decode` | method | before 11.6.1 | — |
| `DeflateStringENC` | method | before 11.6.1 | — |
| `Encode` | method | before 11.6.1 | — |
| `ExamineFile` | method | before 11.6.1 | — |
| `ExamineMemory` | method | before 11.6.1 | — |
| `GetDt` | method | before 11.6.1 | — |
| `InflateStringENC` | method | before 11.6.1 | — |
| `ReadFile` | method | before 11.6.1 | — |
| `UncompressFileToMem` | method | before 11.6.1 | — |
| `UncompressMemory` | method | before 11.6.1 | — |
| `UncompressMemToFile` | method | before 11.6.1 | — |
| `UncompressString` | method | before 11.6.1 | — |
| `WriteFile` | method | before 11.6.1 | — |

## Related classes

[`BinData`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/wc/classes/BinData.md), [`CkDateTime`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/wc/classes/CkDateTime.md), [`JsonObject`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/wc/classes/JsonObject.md), [`StringBuilder`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/wc/classes/StringBuilder.md), [`Task`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/wc/classes/Task.md)

