Movatterモバイル変換


[0]ホーム

URL:


source::encoding
(source,CPAN)
version 0.01

CONTENTS

#NAME

source::encoding -- Declare Perl source code encoding

#SYNOPSIS

use source::encoding 'ascii';use source::encoding 'utf8';no source::encoding;

#DESCRIPTION

These days, Perl code either generally contains only ASCII characters with\x{} and similar escapes to represent non-ASCII, oruse utf8 is used to indicate that the source code itself contains characters encoded as UTF-8.

That means that a character in the source code not meeting these criteria is often a typographical error. This pragma is used to tell Perl to raise an error when this happens.

use source::encoding 'utf8' is a synonym foruse utf8. They may be used interchangeably.

use source::encoding 'ascii' turns off any UTF-8 expectations, and raises a fatal error if any character within its scope in the input source code is not ASCII (or ASCII-equivalent on EBCDIC systems).

no source::encoding turns off any UTF-8/ASCII expectations for the remainder of its scope. The meaning of non-ASCII characters is then undefined.

use source::encoding 'ascii' is automatically enabled within the lexical scope of ause v5.41.0 or higher.

#SEE ALSO

utf8

Perldoc Browser is maintained by Dan Book (DBOOK). Please contact him via theGitHub issue tracker oremail regarding any issues with the site itself, search, or rendering of documentation.

The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via thePerl issue tracker, themailing list, orIRC to report any issues with the contents or format of the documentation.


[8]ページ先頭

©2009-2025 Movatter.jp