> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/man/iconv/iconvlist.3.md).

# iconvlist.3

`iconvlist` — 获取 [iconv(3)](/man/iconv/iconv.3.md) 所支持的字符编码列表

## 名称

`iconvlist`

## 库

Lb libc

## 概要

`#include <iconv.h>`

`Ft void Fo iconvlist int *do_oneunsigned int count, const char * const *names, void *arg void *arg Fc`

## 描述

`iconvlist` 函数获取 [iconv(3)](/man/iconv/iconv.3.md) 调用所支持的字符编码列表。将调用 `do_one` 回调函数，其中 `count` 参数设置为找到的编码名称数量，`names` 参数为支持的编码名称列表，`arg` 参数为 `iconvlist` 函数的 “外部” `arg` 参数。此参数可用于在 `iconvlist` 的调用者和回调函数之间交换自定义数据。

若发生错误，调用 `do_one` 时 `names` 将为 `NULL`。

## 参见

\_\_iconv\_free\_list(3), [\_\_iconv\_get\_list(3)](/man/iconv/__iconv_get_list.3.md), [iconv(3)](/man/iconv/iconv.3.md)

## 标准

`iconvlist` 函数是非标准扩展，最早出现于 GNU 实现，为兼容性考虑在 FreeBSD 9.0 中引入。

## 作者

本手册页由 Gabor Kovesdan <gabor@FreeBSD.org> 编写。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://book.bsdcn.org/man/iconv/iconvlist.3.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
