=head1 SYNOPSIS
- use utf8;
- no utf8;
+ use utf8;
+ no utf8;
- # Convert the internal representation of a Perl scalar to/from UTF-8.
+ # Convert the internal representation of a Perl scalar to/from UTF-8.
- $num_octets = utf8::upgrade($string);
- $success = utf8::downgrade($string[, FAIL_OK]);
+ $num_octets = utf8::upgrade($string);
+ $success = utf8::downgrade($string[, FAIL_OK]);
- # Change each character of a Perl scalar to/from a series of
- # characters that represent the UTF-8 bytes of each original character.
+ # Change each character of a Perl scalar to/from a series of
+ # characters that represent the UTF-8 bytes of each original character.
- utf8::encode($string); # "\x{100}" becomes "\xc4\x80"
- utf8::decode($string); # "\xc4\x80" becomes "\x{100}"
+ utf8::encode($string); # "\x{100}" becomes "\xc4\x80"
+ utf8::decode($string); # "\xc4\x80" becomes "\x{100}"
- $flag = utf8::is_utf8(STRING); # since Perl 5.8.1
- $flag = utf8::valid(STRING);
+ $flag = utf8::is_utf8(STRING); # since Perl 5.8.1
+ $flag = utf8::valid(STRING);
=head1 DESCRIPTION
individual I<UTF-X> bytes of the character. The UTF8 flag is turned off.
Returns nothing.
- my $a = "\x{100}"; # $a contains one character, with ord 0x100
- utf8::encode($a); # $a contains two characters, with ords 0xc4 and 0x80
+ my $a = "\x{100}"; # $a contains one character, with ord 0x100
+ utf8::encode($a); # $a contains two characters, with ords 0xc4 and
+ # 0x80
B<Note that this function does not handle arbitrary encodings.>
Therefore Encode is recommended for the general purposes; see also
characters. If I<$string> is invalid as I<UTF-X>, returns false;
otherwise returns true.
- my $a = "\xc4\x80"; # $a contains two characters, with ords 0xc4 and 0x80
+ my $a = "\xc4\x80"; # $a contains two characters, with ords
+ # 0xc4 and 0x80
utf8::decode($a); # $a contains one character, with ord 0x100
B<Note that this function does not handle arbitrary encodings.>
lib/tie/array.pm Verbatim line length including indents exceeds 79 by 1
lib/tie/hash.pm Verbatim line length including indents exceeds 79 by 3
lib/tie/scalar.pm Verbatim line length including indents exceeds 79 by 1
-lib/utf8.pm Verbatim line length including indents exceeds 79 by 4
lib/version.pod Verbatim line length including indents exceeds 79 by 1
lib/version/internals.pod Verbatim line length including indents exceeds 79 by 2
lib/vmsish.pm Verbatim line length including indents exceeds 79 by 1