# perldoc > Encode::CN

---
type: CommandReference
command: Encode::CN
mode: perldoc
section: 
source: perldoc
---

## Quick Reference

- `use Encode qw/encode decode/` — load Encode and its functions
- `$euc_cn = encode("euc-cn", $utf8)` — encode UTF-8 to EUC-CN
- `$utf8 = decode("euc-cn", $euc_cn)` — decode EUC-CN to UTF-8

## Name

China-based Chinese Encodings

## Synopsis

perl
use Encode qw/encode decode/;
$euc_cn = encode("euc-cn", $utf8);   # loads Encode::CN implicitly
$utf8   = decode("euc-cn", $euc_cn); # ditto
## Options (Supported Encodings)

- `euc-cn` — EUC (Extended Unix Character). Commonly aliased to `gb2312` due to charset mislabeling. See Bug notes.
- `gb2312-raw` — Raw low-bit GB2312 character map.
- `gb12345-raw` — Traditional Chinese counterpart to GB2312 (raw).
- `iso-ir-165` — GB2312 + GB6345 + GB8565 + additions.
- `MacChineseSimp` — GB2312 + Apple Additions.
- `cp936` — Code Page 936, also known as GBK (Extended GuoBiao).
- `hz` — 7-bit escaped GB2312 encoding.

## Examples

perl
use Encode qw/encode decode/;
$euc_cn = encode("euc-cn", $utf8);
$utf8   = decode("euc-cn", $euc_cn);
## Notes

- Due to size concerns, GB 18030 (an extension to GBK) is distributed separately on CPAN as `Encode::HanExtra` (also contains extra Taiwan-based encodings).
- When you see `charset=gb2312` on mails and web pages, it really means "euc-cn" encoding. To fix that, `gb2312` is aliased to `euc-cn`. Use `gb2312-raw` for the actual raw map.
- The ASCII region (0x00-0x7f) is preserved for all encodings, even though this conflicts with mappings by the Unicode Consortium.

## See Also

- [Encode](https://perldoc.perl.org/Encode)