# 使用 Homebrew, MacPorts, Nix, pacman, scoop 安装 libiconv

查看 libiconv 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:libiconv
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install libiconv
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install libiconv
```

  证据: MacPorts ports tree: textproc/libiconv/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#libiconv
```

  证据: nixpkgs package indexes: libiconv from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

- pacman (92%):

```sh
sudo pacman -S libiconv
```

  证据: Arch Linux sync databases: libiconv from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

### Windows

- Scoop (92%):

```sh
scoop install main/iconv
```

  证据: Scoop official bucket manifest trees: bucket/iconv.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:libiconv
- **软件包管理器:** Homebrew
- **版本:** 1.19
- **来源摘要:** Conversion library
- **主页:** <https://www.gnu.org/software/libiconv/>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- iconv (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 1.19
## 项目历史与用法

GNU libiconv is the GNU character-set conversion library for systems that lack a usable iconv implementation or lack Unicode-capable conversions.

### 项目历史

The GNU project page frames libiconv around the internet-era problem of moving text among Unicode and older language- or country-dependent encodings. It provides both the iconv() library interface and an iconv command-line program.

GNU libiconv's long-term role has been portability rather than novelty: it supplies consistent conversion support on platforms where libc iconv is absent, incomplete, or not compatible with the encodings an application needs.

### 采用历史

The package became common in Unix packaging because many projects use Autoconf tests for iconv and need a fallback on macOS, BSD, Windows ports, or older commercial Unix systems.

The GNU documentation explicitly calls out GNU gettext integration and the circular first-install relationship between gettext and libiconv on some systems, which is why packagers often care about bootstrap order.

### 使用方式

Developers link against libiconv through iconv_open, iconv, and iconv_close, while users can call the iconv program to convert files or streams between encodings. Build systems commonly surface it through LIBICONV or LTLIBICONV substitutions.

### 为什么软件包爱好者会关心

libiconv is one of the classic portability packages: invisible when libc has enough charset support, essential when it does not. It also exposes subtle packaging choices around libc replacement, gettext, locale charsets, and whether a dependency should use the system iconv or GNU's implementation.

For package maintainers, it is a reminder that text encoding is infrastructure. A tiny mismatch in iconv availability can decide whether internationalized software builds or produces correct output.

### 时间线

- 1998: GNU libiconv documentation carries Free Software Foundation copyright from this period.
- 2024: GNU libiconv 1.18 release notes described POSIX:2024 API compatibility work.
- 2026: The GNU project page documented libiconv 1.19 source and manuals.

### Related projects

- GNU gettext is closely related because gettext can use libiconv for message conversion and shares build-system history around iconv.m4.
- glibc iconv is the main system implementation that may make GNU libiconv unnecessary on GNU/Linux systems.
- POSIX iconv is the standard API surface that libiconv implements for portable software.

### 来源

- <https://formulae.brew.sh/formula/libiconv>
- <https://lists.gnu.org/archive/html/info-gnu/2024-12/msg00004.html>
- <https://www.gnu.org/software/libiconv>
- <https://www.gnu.org/software/libiconv/documentation/libiconv-1.19/iconv.1.html>
- <https://www.gnu.org/software/libiconv/documentation/libiconv-1.19/iconv.3.html>


## 安全说明

library-like package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- library-like package without higher-risk signals

## 其他软件包管理器记录

- Nix - libiconv: normalized package name match | nixpkgs package indexes: libiconv from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- pacman - libiconv - 1.19-1: normalized package name match | Arch Linux sync databases: libiconv from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | GNU charset conversion library | http://www.gnu.org/software/libiconv/
- MacPorts - libiconv: normalized package name match | MacPorts ports tree: textproc/libiconv/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Nix - iconv: installed executable or alias match | nixpkgs package indexes: iconv from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- Scoop - main/iconv: installed executable or alias match | Scoop official bucket manifest trees: bucket/iconv.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/libiconv.yml](https://github.com/mxcl/pkgdb/blob/main/combined/libiconv.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
