# 使用 Homebrew, dnf, Nix, pacman, apt, zypper 安装 libchardet

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

## 安装

```sh
sudo av install brew:libchardet
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install libchardet
```

  证据: local Homebrew formula metadata

### Linux

- dnf (92%):

```sh
sudo dnf install libchardet
```

  证据: Fedora Rawhide package metadata: libchardet from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#libchardet
```

  证据: nixpkgs package indexes: pkgs/by-name/li/libchardet/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S libchardet
```

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

- Debian apt (92%):

```sh
sudo apt install libchardet-dev
```

  证据: Debian stable package indexes: libchardet-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- zypper (92%):

```sh
sudo zypper install libchardet-devel
```

  证据: openSUSE Tumbleweed package metadata: libchardet-devel from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

## 软件包事实

- **软件包键:** brew:libchardet
- **软件包管理器:** Homebrew
- **版本:** 1.0.6
- **来源摘要:** Mozilla's Universal Charset Detector C/C++ API
- **主页:** <https://github.com/Joungkyun/libchardet>
- **仓库:** <https://github.com/Joungkyun/libchardet>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- chardet-config (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

libchardet is a C/C++ API around Mozilla's Universal Charset Detector lineage. It detects the likely character encoding of byte streams, a task that matters when programs ingest legacy text without reliable charset labels.

### 项目历史

Mozilla's archived charset detector documentation describes the original detector as an XPCOM component that receives bytes and guesses the charset. A companion Mozilla document from 2002 explains that the universal detector implementation was separable from the XPCOM wrapper and could be used by other projects.

The libchardet README says the library is based on Mozilla Universal Charset Detector code originally written by Netscape Communications Corporation, with a C wrapping API and libtool build environment. It also records later changes: version 1.0.5 incorporated single-byte charset confidence ideas and language models from uchardet, and version 1.0.6 added BOM reporting.

### 采用历史

libchardet's adoption is narrower than Python chardet or uchardet, but it fills the same packaging niche for C/C++ consumers that need Mozilla-style charset guessing without embedding the whole browser-era component. The batch input lists packages in Homebrew, Debian/Ubuntu, Fedora, Arch, Nix, and openSUSE, mostly as a development library.

### 使用方式

The repository documents a small API centered on detect_obj_init, detect or detect_r, confidence reporting, and object cleanup. The package also installs chardet-config for build integration, so downstream C/C++ projects can compile against the library.

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

libchardet is significant because charset detection is one of those small compatibility problems that keeps returning in editors, importers, scrapers, mail tools, and document converters. It also shows how browser infrastructure escaped into standalone libraries: Mozilla/Netscape detection code became reusable C, Python, Perl, and other language bindings.

### 时间线

- 2002-08-15: Mozilla charset detector documentation was last modified.
- 2002-11-06: Mozilla standalone universal charset detector notes described using the detector outside Mozilla.
- 2019: libchardet README copyright line names JoungKyun.Kim and describes the standalone C/C++ API.
- 2021-05-13: GitHub release listing shows libchardet 1.0.6.

### Related projects

- Related projects include Mozilla Universal Charset Detector, uchardet, Python chardet, John Gardiner Myers's Encode-Detect Perl module, and applications that need to infer encodings before decoding text.

### 来源

- <https://formulae.brew.sh/formula/libchardet>
- <https://github.com/Joungkyun/libchardet>
- <https://www-archive.mozilla.org/projects/intl/chardet.html>
- <https://www-archive.mozilla.org/projects/intl/detectorsrc>
- <https://www-archive.mozilla.org/projects/intl/universalcharsetdetection>


## 安全说明

library-like package without higher-risk signals.

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

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

- Debian apt - libchardet-dev - 1.0.6-1: normalized package name match | Debian stable package indexes: libchardet-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | universal charset detection library - development files | https://github.com/Joungkyun/libchardet
- Debian apt - libchardet1t64 - 1.0.6-1: normalized package name match | Debian stable package indexes: libchardet1t64 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | universal charset detection library - shared library | https://github.com/Joungkyun/libchardet
- Nix - libchardet: normalized package name match | nixpkgs package indexes: pkgs/by-name/li/libchardet/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - libchardet-dev - 1.0.4-1.1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libchardet-dev from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | universal charset detection library - development files | https://ftp.oops.org/pub/oops/libchardet/
- Ubuntu apt - libchardet1t64 - 1.0.4-1.1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libchardet1t64 from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | universal charset detection library - shared library | https://ftp.oops.org/pub/oops/libchardet/
- dnf - libchardet - 1.0.5-24.fc45: normalized package name match | Fedora Rawhide package metadata: libchardet from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Mozilla's universal character set detector | http://ftp.oops.org/pub/oops/libchardet/
- dnf - libchardet-devel - 1.0.5-24.fc45: normalized package name match | Fedora Rawhide package metadata: libchardet-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Header and object files for development using libchardet | http://ftp.oops.org/pub/oops/libchardet/
- pacman - libchardet - 1.0.6-4: normalized package name match | Arch Linux sync databases: libchardet from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Mozilla's Universal Charset Detector C/C++ API | http://ftp.oops.org/pub/oops/libchardet
- zypper - libchardet-devel - 1.0.6-2.6: normalized package name match | openSUSE Tumbleweed package metadata: libchardet-devel from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Development files of libchardet | https://github.com/Joungkyun/libchardet
- zypper - libchardet1 - 1.0.6-2.6: normalized package name match | openSUSE Tumbleweed package metadata: libchardet1 from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Mozilla Universal Chardet library | https://github.com/Joungkyun/libchardet


## Combined YAML source

View the package source record on GitHub. [combined/libchardet.yml](https://github.com/mxcl/pkgdb/blob/main/combined/libchardet.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
