The 'Encode' module provides the interface between Perl strings and the rest of the system. Perl strings are sequences of characters.
The repertoire of characters that Perl can represent is a superset of those defined by the Unicode Consortium. On most platforms the ordinal values of a character as returned by 'ord(S)' is the Unicode codepoint for that character. The exceptions are platforms where the legacy encoding is some variant of EBCDIC rather than a superset of ASCII; see perlebcdic.
During recent history, data is moved around a computer in 8-bit chunks, often called "bytes" but also known as "octets" in standards documents. Perl is widely used to manipulate data of many types: not only strings of characters representing human or computer languages, but also "binary" data, being the machine's representation of numbers, pixels in an image, or just about anything.
When Perl is processing "binary data", the programmer wants Perl to process "sequences of bytes". This is not a problem for Perl: because a byte has 256 possible values, it easily fits in Perl's much larger "logical character".
This document mostly explains the how. perlunitut and perlunifaq explain the why.
Package Version | Update ID | Released | Package Hub Version | Platforms | Subpackages |
---|---|---|---|---|---|
3.19-bp156.2.4 info | GA Release | 2023-12-07 | 15 SP6 |
|
|
3.19-bp155.1.5 info | GA Release | 2023-05-17 | 15 SP5 |
|
|
3.16-bp154.1.15 info | GA Release | 2022-05-09 | 15 SP4 |
|
|
2.98-bp153.1.16 info | GA Release | 2021-03-06 | 15 SP3 |
|
|
2.98-bp152.3.13 info | GA Release | 2020-04-16 | 15 SP2 |
|
|
2.98-bp151.3.1 info | GA Release | 2019-07-17 | 15 SP1 |
|
|
2.98-bp151.2.14 info | GA Release | 2019-05-18 | 15 SP1 |
|
|
2.98-bp150.2.5 info | GA Release | 2018-07-30 | 15 |
|
|
2.98-bp150.2.4 info | GA Release | 2018-07-30 | 15 |
|
|