PHP 手册
后退 |  | 前进

# XLVI. GNU Recode Functions

# 简介

This module contains an interface to the GNU Recode library. The GNU Recode library converts files between various coded character sets and surface encodings. When this cannot be achieved exactly, it may get rid of the offending characters or fall back on approximations. The library recognises or produces nearly 150 different character sets and is able to convert files between almost any pair. Most RFC 1345 character sets are supported.

> 注: 本扩展模块在 Windows 平台下不可用。

# 需求

You must have GNU Recode 3.5 or higher installed on your system. You can download the package from http://directory.fsf.org/All_GNU_Packages/recode.html.

警告
The Recode library version 3.6 adds weird characters behind converted strings under certain circumstances. Thus it's safer to use Recode v3.5 or one of the available alternatives like the iconv or mbstring extension.

# 安装

To be able to use the functions defined in this module you must compile your PHP interpreter using the --with-recode[=DIR] option.

警告
Crashes and startup problems of PHP may be encountered when loading the recode as extension after loading any extension of mysql or imap. Loading the recode before those extension has proved to fix the problem. This is due a technical problem that both the c-client library used by imap and recode have their own hash_lookup() function and both mysql and recode have their own hash_insert function.

警告
IMAP 扩展模块不能和 recode 扩展模块，YAZ 扩展模块以及 Cyrus 扩展模块同时使用。因为它们使用了相同的内部符号。

# 运行时配置

本扩展模块在 `php.ini` 中未定义任何配置选项。

# 资源类型

本扩展模块未定义任何资源类型。

# 预定义常量

本扩展模块未定义任何常量。

后退 | 起点 | 前进
readline | 上一级 | recode_file