{"id":190584,"date":"2013-08-19T22:45:06","date_gmt":"2013-08-19T18:45:06","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=190584"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=190584","title":{"rendered":"<span class=\"post_title\">\u0412\u0441\u044f \u043f\u0440\u0430\u0432\u0434\u0430 \u043e UTF-8 \u0444\u043b\u0430\u0433\u0435<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/204\/044\/55a\/20404455ac40f027b0b0fcd46c7fdea1.jpg\"\/><\/p>\n<p>  \u0420\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u043e\u0435 \u0437\u0430\u0431\u043b\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0441\u0442\u0440\u043e\u043a \u0431\u0430\u0439\u0442\u043e\u0432, \u0438\u043c\u0435\u044e\u0442 UTF-8 \u0444\u043b\u0430\u0433 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c.<br \/>  \u041c\u043d\u043e\u0433\u0438\u0435 \u0434\u043e\u0433\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f ASCII-7-bit, \u0442\u043e UTF-8 \u0444\u043b\u0430\u0433 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0432\u0430\u0436\u0435\u043d.<\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e, \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0438\u043b\u0438 \u0441\u0431\u0440\u043e\u0448\u0435\u043d, \u043a\u0430\u043a \u0438 \u0443 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0442\u0430\u043a \u0438 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0445 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u0428\u0438\u0440\u043e\u043a\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0432 Perl \u043a\u043e\u043c\u044c\u044e\u043d\u0438\u0442\u0438 \u0430\u0432\u0442\u043e\u0440 <i>Marc Lehmann<\/i> \u0434\u0435\u043b\u0430\u0435\u0442 \u043e\u0431 \u044d\u0442\u043e\u043c \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043a \u043c\u043e\u0434\u0443\u043b\u044e <a href=\"http:\/\/search.cpan.org\/~mlehmann\/JSON-XS-2.34\/XS.pm#A_FEW_NOTES_ON_UNICODE_AND_PERL\">JSON::XS<\/a><\/p>\n<blockquote><p>You can have Unicode strings with that flag set, with that flag clear, and you can have binary data with that flag set and that flag clear. Other possibilities exist, too.  <\/p><\/blockquote>\n<h5>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 ASCII-7bit \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u043c\u0435\u044e\u0442 UTF-8 \u0444\u043b\u0430\u0433 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c.<\/h5>\n<pre><code class=\"perl\">use utf8; use strict; use warnings; my $u = &quot;\u0442\u0435\u0441\u0442&quot;; # unicode \u0441\u0442\u0440\u043e\u043a\u0430 my $ascii = &quot;x&quot;; # \u043e\u0431\u044b\u0447\u043d\u044b\u0439 ASCII \u0441\u0438\u043c\u0432\u043e\u043b my ($ascii_u, undef) = split(\/ \/, &quot;$ascii $u&quot;); die unless $ascii_u eq &quot;x&quot;; # \u0442\u043e\u0442 \u0436\u0435 ASCII \u0441\u0438\u043c\u0432\u043e\u043b print &quot;UTF-8 flag set!&quot; if utf8::is_utf8($ascii_u); # \u043d\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0435\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d UTF-8 \u0444\u043b\u0430\u0433 <\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u00abUTF-8 flag set!\u00bb. \u0422\u043e \u0435\u0441\u0442\u044c ASCII-7bit \u0441\u0442\u0440\u043e\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430 \u044d\u0442\u043e\u0442 \u0444\u043b\u0430\u0433, \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f split \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043b\u0430 Unicode \u0441\u0442\u0440\u043e\u043a\u0443 (\u0441 UTF-8 \u0444\u043b\u0430\u0433\u043e\u043c) \u043d\u0430 \u0447\u0430\u0441\u0442\u0438. \u041c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043d\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442 \u0431\u0443\u0434\u0435\u0442 \u043b\u0438 \u0443 \u0435\u0433\u043e ASCII \u0434\u0430\u043d\u043d\u044b\u0445 UTF-8 \u0444\u043b\u0430\u0433 \u0438\u043b\u0438 \u043d\u0435\u0442, \u044d\u0442\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0442\u043e\u0433\u043e, \u043e\u0442\u043a\u0443\u0434\u0430 \u0438 \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0435, \u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u044b\u043b\u0438 \u0440\u044f\u0434\u043e\u043c \u0441 \u043d\u0438\u043c\u0438.<\/p>\n<p>  \u0422\u043e\u0442 \u0436\u0435 \u044d\u0444\u0444\u0435\u043a\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c ASCII-7bit \u0431\u0430\u0439\u0442\u044b \u0432 ASCII-7bit \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"http:\/\/search.cpan.org\/~dankogai\/Encode-2.52\/Encode.pm#decode\">Encode::decode()<\/a><\/p>\n<pre><code class=\"perl\">use strict; use warnings; use Encode; my $ascii = 'x'; # ASCII \u0441\u0438\u043c\u0432\u043e\u043b my $ascii_u = decode(&quot;UTF-8&quot;, encode(&quot;UTF-8&quot;, &quot;$ascii&quot;)); die unless $ascii_u eq &quot;x&quot;; # \u0442\u043e\u0442 \u0436\u0435 ASCII \u0441\u0438\u043c\u0432\u043e\u043b print &quot;UTF-8 flag set!&quot; if utf8::is_utf8($ascii_u); # \u043d\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0435\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d UTF-8 \u0444\u043b\u0430\u0433 <\/code><\/pre>\n<p>  \u0422.\u0435. \u043f\u0435\u0440\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430 \u0442\u0443\u0434\u0430-\u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 (\u044d\u0442\u043e \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e), \u043d\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 UTF-8 \u0444\u043b\u0430\u0433.<br \/>  (\u0432\u043f\u0440\u043e\u0447\u0435\u043c, \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 decode() <a href=\"https:\/\/rt.cpan.org\/Public\/Bug\/Display.html?id=34259\">\u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0442<\/a> \u0435\u0433\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 <a href=\"http:\/\/search.cpan.org\/~dankogai\/Encode-2.52\/Encode.pm#The_UTF8_flag\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0442 \u0438\u0434\u0435\u0435, \u0447\u0442\u043e \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0439 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e utf-8 \u0444\u043b\u0430\u0433\u0430 \u0432 ASCII \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u044b\u0442\u044c \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e)<\/p>\n<p>  \u041e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u0436\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u044b \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 UTF-8 \u0444\u043b\u0430\u0433\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438. \u0421\u043b\u0438\u0448\u043a\u043e\u043c \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u043e \u043f\u043e\u0441\u043b\u0435 split \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u043b\u0438 \u043e\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 ASCII \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0438 \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0444\u043b\u0430\u0433.<\/p>\n<p>  \u0422\u0430\u043a\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 UTF-8 \u0444\u043b\u0430\u0433\u0430 \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u0432\u0438\u0440\u0443\u0441 \u2014 \u043e\u043d \u0437\u0430\u0440\u0430\u0436\u0430\u0435\u0442 \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0441\u043e\u043f\u0440\u0438\u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f.<\/p>\n<h5>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435-ASCII, Unicode \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 UTF-8 \u0444\u043b\u0430\u0433\u0430.<\/h5>\n<pre><code class=\"perl\">use strict; use warnings; use Digest::SHA qw\/sha1_hex\/; use utf8; my $s = &quot;\u00b5&quot;; my $s1 = $s; my $s2 = $s;  my $digest = sha1_hex($s2); # \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0440\u043e\u0447\u043a\u0443  print &quot;utf-8 bit ON (s1)\\n&quot; if utf8::is_utf8($s1); print &quot;utf-8 bit ON (s2)\\n&quot; if utf8::is_utf8($s2);  print &quot;s1 and s2 are equal\\n&quot; if $s1 eq $s2; <\/code><\/pre>\n<p>  \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442:<\/p>\n<pre> utf-8 bit ON (s1) s1 and s2 are equal <\/pre>\n<p>  \u0422\u043e \u0435\u0441\u0442\u044c \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0441\u0431\u0440\u043e\u0441\u0438\u043b UTF-8 \u0444\u043b\u0430\u0433. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c, \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u0444\u043b\u0430\u0433\u043e\u043c \u0438 \u0431\u0435\u0437, \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b\u043c\u0438.<br \/>  \u0422\u0430\u043a\u043e\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438 &gt; 127 \u0438 &lt;=255 (\u0442.\u0435. Latin-1).<\/p>\n<p>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u043e\u0439 $s2 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f <b>utf8::downgrade<\/b><\/p>\n<p>  \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u0432 <a href=\"http:\/\/search.cpan.org\/perldoc?utf8\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>, \u043a\u0430\u043a \u043c\u0435\u043d\u044f\u044e\u0449\u0430\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<blockquote><p>Converts in-place the internal representation of the string from UTF-X to the equivalent octet sequence in the native encoding (Latin-1 or EBCDIC). The logical character sequence itself is unchanged.  <\/p><\/blockquote>\n<p>  \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u043c\u043e\u0434\u0443\u043b\u044c Digest::SHA \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u0442\u0430\u043a\u043e\u0435 \u0441\u0432\u043e\u0451 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u0445\u043e\u0442\u044f \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u043d:<\/p>\n<blockquote><p>Be aware that the digest routines silently convert UTF-8 input into its<br \/>  equivalent byte sequence in the native encoding (cf. utf8::downgrade). This <br \/>  side effect influences only the way Perl stores the data internally, but<br \/>  otherwise leaves the actual value of the data intact.  <\/p><\/blockquote>\n<p>  \u0412 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043b\u044e\u0431\u0430\u044f 3-rd party \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c downgrade \u0441\u0442\u0440\u043e\u043a\u0438, \u043d\u0435 \u0441\u043e\u043e\u0431\u0449\u0430\u044f \u0432 \u044d\u0442\u043e\u043c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 (\u0438\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u043e\u0433\u0434\u0430).<\/p>\n<h5>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0435, \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u043c\u0435\u044e\u0442 UTF-8 \u0444\u043b\u0430\u0433.<\/h5>\n<pre><code class=\"perl\">use utf8; use strict; use warnings;  # \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d bytes::length \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438, \u0441\u0442\u0430\u0432\u0438\u043c '()' \u0447\u0442\u043e\u0431\u044b bytes \u043d\u0435 \u0432\u043b\u0438\u044f\u043b\u043e \u043d\u0430 \u0445\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b use bytes ();  my $u = &quot;\u0442\u0435\u0441\u0442&quot;; # \u043d\u0435 ASCII \u0441\u0442\u0440\u043e\u043a\u0430  # \u0431\u0430\u0439\u0442\u044b, \u043d\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b my $bin = &quot;\\xf1\\xf2\\xf3&quot;;  ## \u043e\u043f\u044f\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 ASCII \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 UTF-8 \u0444\u043b\u0430\u0433\u043e\u043c my $ascii = &quot;x&quot;; # \u043e\u0431\u044b\u0447\u043d\u044b\u0439 ASCII \u0441\u0438\u043c\u043e\u0432\u043b my ($ascii_u, undef) = split(\/ \/, &quot;$ascii $u&quot;); die unless $ascii_u eq &quot;x&quot;; # \u0442\u043e\u0442 \u0436\u0435 ASCII \u0441\u0438\u043c\u0432\u043e\u043b die unless utf8::is_utf8($ascii_u); # \u043d\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0435\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d UTF-8 \u0444\u043b\u0430\u0433 ## \/\/  print &quot;original bin length:\\t&quot;; print length($bin) . &quot;\\t&quot; . bytes::length($bin) .&quot;\\n&quot;;  my $bin_a = $bin.$ascii; # \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0435\u043c \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0441 ASCII \u0434\u0430\u043d\u043d\u044b\u043c\u0438  print &quot;bin_a length:\\t&quot;; print length($bin_a) . &quot;\\t&quot; . bytes::length($bin_a) .&quot;\\n&quot;;  my $bin_u = $bin.$ascii_u; # \u043e\u043f\u044f\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0435\u043c \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0441 ASCII \u0434\u0430\u043d\u043d\u044b\u043c\u0438  print &quot;bin_u length:\\t&quot;; print length($bin_u) . &quot;\\t&quot; . bytes::length($bin_u) .&quot;\\n&quot;;  print &quot;bin_a and bin_u are equal!\\n&quot; if $bin_a eq $bin_u;  open my $f, &quot;&gt;&quot;, &quot;file_a.tmp&quot;; binmode $f; print $f $bin_a; close $f;  open $f, &quot;&gt;&quot;, &quot;file_u.tmp&quot;; binmode $f; print $f $bin_u; close $f;  system(&quot;md5sum file_?.tmp&quot;); # md5sum - \u043a\u043e\u043c\u0430\u043d\u0434\u0430 linux <\/code><\/pre>\n<p>  \u0432\u044b\u0434\u0430\u0451\u0442:<\/p>\n<pre> original bin length:    3       3 bin_a length:   4       4 bin_u length:   4       7 bin_a and bin_u are equal! 33818f4b23aa74cddb8eb625845a459a  file_a.tmp 33818f4b23aa74cddb8eb625845a459a  file_u.tmp <\/pre>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043d\u043a\u0430\u0442\u0435\u043d\u0430\u0446\u0438\u0438 \u0441 ASCII \u0441\u0442\u0440\u043e\u043a\u043e\u0439, \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u0438 \u0441\u0432\u043e\u0439 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0432 \u0431\u0430\u0439\u0442\u0430\u0445 (\u043d\u043e \u043d\u0435 \u0432 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u0445) \u0441 4 \u0434\u043e 7, \u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438, \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u043d\u0430\u0447\u0430\u0449\u0438\u0439, UTF-8 \u0444\u043b\u0430\u0433 \u0443 ASCII \u0431\u044b\u043b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d.<\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e, \u043f\u0440\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439, \u043e\u043d\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b, \u0442\u0430\u043a\u0436\u0435, \u043f\u0440\u0438 \u0432\u044b\u0432\u043e\u0434\u0435 \u0432 \u0444\u0430\u0439\u043b \u043e\u0431\u043e\u0438\u0445 \u0441\u0442\u0440\u043e\u043a, \u0434\u0430\u0436\u0435 \u0431\u0435\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0438, \u0444\u0430\u0439\u043b\u044b \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u0442\u043e\u0436\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b\u043c\u0438.<\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c\u0441\u044f \u0432 \u0440\u0430\u0437\u043c\u0435\u0440\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c UTF-8 \u0444\u043b\u0430\u0433, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0431\u0430\u0433\u0430 \u043d\u0435\u0442, \u0432\u0441\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Perl \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442 \u0438\u0445 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0435\u0441\u043b\u0438 \u0431\u044b \u0444\u043b\u0430\u0433\u0430 \u043d\u0435 \u0431\u044b\u043b\u043e (\u0435\u0441\u043b\u0438 \u0438 \u0435\u0441\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u0442\u043e \u0431\u0430\u0433 \u0432 \u043d\u0438\u0445).<\/p>\n<p>  \u041b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 perl \u043a\u043e\u0434 \u0442\u043e\u0436\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a (\u0435\u0441\u043b\u0438 \u043e\u043d \u043d\u0435 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044e\u044e \u0441\u0442\u0440\u0443\u043a\u0443\u0442\u0443\u0440\u0443 \u0441\u0442\u0440\u043e\u043a\u0438, \u0438\u043b\u0438 \u0445\u043e\u0442\u044f \u0431\u044b \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0435\u0451 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e)<\/p>\n<p>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0442\u043e, \u0447\u0442\u043e \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0441 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 <b>utf8::upgrade<\/b>. \u0414\u0430\u043d\u043d\u044b\u0435 \u0431\u044b\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043a\u0430\u043a Latin-1, \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b \u0432 UTF-8, \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d UTF-8 \u0444\u043b\u0430\u0433. \u042d\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u0430 <b>utf8::downgrade<\/b>, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0432\u044b\u0448\u0435. <b>utf8::downgrade<\/b> \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0441 Latin-1 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438. \u0410 <b>utf8::upgrade<\/b> \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f<br \/>  \u0441 \u043b\u044e\u0431\u044b\u043c\u0438 \u0431\u0430\u0439\u0442\u0430\u043c\u0438 (\u0442.\u043a. \u043b\u044e\u0431\u043e\u043c\u0443 \u0431\u0430\u0439\u0442\u0443 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0438\u043c\u0432\u043e\u043b \u0438\u0437 Latin-1).<\/p>\n<p>  \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u0430\u0436\u043d\u043e, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u0431\u044a\u0451\u043c \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0421\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0437\u0434\u043e\u0440\u043e\u0432\u043e, \u0435\u0441\u043b\u0438 400 \u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442\u043d\u044b\u0439 \u0431\u043b\u043e\u0431, \u0432\u0434\u0440\u0443\u0433 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 700 \u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442\u043d\u044b\u0439, \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0432\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0442\u0443\u0434\u0430 \u043e\u0434\u0438\u043d ASCII-7bit \u0431\u0430\u0439\u0442 \u0441 UTF-8 \u0444\u043b\u0430\u0433\u043e\u043c. \u0425\u043e\u0440\u043e\u0448\u0438\u0439 \u0432\u044b\u0445\u043e\u0434 \u0438\u0437 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0437\u0434\u0435\u0441\u044c \u2014 unit \u0442\u0435\u0441\u0442\u044b \u0438\u043b\u0438 runtime <a href=\"http:\/\/en.wikipedia.org\/wiki\/Assertion_%28software_development%29\">assertions<\/a> \u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 UTF-8 \u0444\u043b\u0430\u0433\u0430.<\/p>\n<h5>\u0412 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0438\u0442\u044c \u0431\u0430\u0439\u0442\u044b \u043e\u0442 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432<\/h5>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0437\u0430\u0434\u0430\u0447\u0443: \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043d\u0430 \u0432\u0445\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f XML, \u0435\u0441\u043b\u0438 XML \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0430\u0439\u0442\u0430\u043c\u0438, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0443 \u0432 \u0442\u0435\u0433\u0435 \u00abxml\u00bb \u0438 \u043f\u0435\u0440\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u0441\u0438\u043c\u0432\u043e\u043b\u044b. \u0415\u0441\u043b\u0438 \u043e\u043d\u0430 \u0443\u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438, \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n<p>  \u0422\u0430\u043a\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0441\u0442\u0440\u043e\u043a\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u00abHello, M\u00fcnchen\u00bb, \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442<br \/>  \u043e\u0442\u043b\u0438\u0447\u0438\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u044d\u0442\u043e, \u0438\u043b\u0438 \u0431\u0430\u0439\u0442\u044b \u0432 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435 CP1251, \u0438\u043b\u0438 \u0432 KOI8-R (\u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f downgraded, \u0430 \u044d\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0432 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442).<\/p>\n<p>  \u0414\u043b\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 &gt; 255, UTF-8 \u0444\u043b\u0430\u0433 \u0432\u0441\u0435\u0433\u0434\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d (\u0441 \u043d\u0438\u043c\u0438 \u043d\u0435\u043b\u044c\u0437\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c <b>utf8::downgrade<\/b>). \u0414\u043b\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0441 \u043a\u043e\u0434\u043e\u043c &lt;= 127 UTF-8 \u0431\u0438\u0442 \u043d\u0435 \u0432\u0430\u0436\u0435\u043d, \u0432 \u0442\u043e\u043c \u043f\u043b\u0430\u043d\u0435, \u0447\u0442\u043e \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0438 \u043a\u0430\u043a \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0438 \u043a\u0430\u043a \u0441\u0438\u043c\u0432\u043e\u043b\u044b. \u0414\u043b\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 Latin1 \u2014 \u043e\u0442\u043b\u0438\u0447\u0438\u0442\u044c \u043e\u0442 \u0431\u0430\u0439\u0442\u043e\u0432 \u043d\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.<\/p>\n<p>  \u041e\u0442\u043b\u0438\u0447\u0438\u0442\u044c \u0431\u0430\u0439\u0442\u044b \u043e\u0442 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 Perl \u2014 \u044d\u0442\u043e \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0447\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u0438\u0442\u044c \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u043e\u0442 email \u0438 \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430. \u0418\u043d\u043e\u0433\u0434\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043d\u043e \u0432 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2014 \u043d\u0435\u0442. \u0421\u0430\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u0432 \u043a\u0430\u043a\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0447\u0442\u043e \u0443 \u043d\u0435\u0433\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f.<\/p>\n<p>  \u042d\u0442\u043e \u0435\u0441\u0442\u044c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438:<\/p>\n<p>  <a href=\"http:\/\/perldoc.perl.org\/perlunifaq.html\">perldoc.perl.org\/perlunifaq.html<\/a><\/p>\n<blockquote><p>How can I determine if a string is a text string or a binary string?<\/p>\n<p>  You can&#8217;t. Some use the UTF8 flag for this, but that&#8217;s misuse, and makes well behaved modules like Data::Dumper look bad. The flag is useless for this purpose, because it&#8217;s off when an 8 bit encoding (by default ISO-8859-1) is used to store the string.<\/p>\n<p>  This is something you, the programmer, has to keep track of; sorry. You could consider adopting a kind of \u00abHungarian notation\u00bb to help with this.  <\/p><\/blockquote>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0432\u0441\u0451 \u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 \u0431\u0430\u0439\u0442\u043e\u0432 \u0438\u043b\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0438 \u0444\u043b\u0430\u0433, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0447\u0442\u043e \u044d\u0442\u043e (\u0442\u043e\u0442 \u0436\u0435 \u0442\u0440\u044e\u043a \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 \u0434\u043b\u044f email vs \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 vs \u0438\u043c\u044f \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430).<\/p>\n<h5>Wide characters \u043d\u0435 \u0432\u044b\u0434\u0430\u0451\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0438\u0437 Latin-1<\/h5>\n<p>  \u0421\u043b\u0443\u0434\u0435\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0434\u0430\u0451\u0442 warning <i>Wide characters in print<\/i> \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442 $s2<\/p>\n<pre><code class=\"perl\">use strict; use warnings; use utf8; my $s1 = &quot;\u00df&quot;; my $s2 = &quot;\u0442\u0435\u0441\u0442&quot;; my $s = $ARGV[0] ? $s1 : $s2; print $s; <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u043c\u044b \u043f\u0435\u0447\u0430\u0442\u0435\u043c $s1, Perl \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u0442 Unicde \u0441\u0438\u043c\u0432\u043e\u043b \u00b5 (U+00DF, UTF-8 \\xC3xF9) \u0432 \u0431\u0430\u0439\u0442 \\xDF \u0438 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0435\u0433\u043e \u043d\u0430 \u044d\u043a\u0440\u0430\u043d.<br \/>  \u0422\u0430\u043a\u043e\u0435 \u0436\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0441\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u043e \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u0431\u0430\u0439\u0442\u044b, \u0430 \u043d\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b (print, syswrite \u0431\u0435\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0438, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u044b\u0435 \u0441\u0443\u043c\u043c\u044b SHA, MD5, CRC32, MIME::Base64).<\/p>\n<h5>\u0412\u0438\u0440\u0443\u0441\u043d\u044b\u0439 downgrade<\/h5>\n<p>  \u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u0431\u044b\u043b\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u00ab\u0432\u0438\u0440\u0443\u0441\u043d\u043e\u0435\u00bb \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 UTF-8 \u0431\u0438\u0442\u0430 \u0443 ASCII \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 (\u0432\u0438\u0440\u0443\u0441\u043d\u044b\u0439 <b>utf8::upgrade<\/b>). \u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u00ab\u0432\u0438\u0440\u0443\u0441\u043d\u044b\u0439\u00bb \u0441\u0431\u0440\u043e\u0441 UTF-8 \u0431\u0438\u0442\u0430 \u0443 Latin-1 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 <b>(utf8::downgrade<\/b>).<\/p>\n<p>  \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0434 \u0431\u0430\u0439\u0442\u0430\u043c\u0438, \u0430 \u043d\u0435 \u043d\u0430\u0434 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438, \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f hash-\u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, Mime::Base64 \u0438 \u0442.\u0434.<\/p>\n<p>  1. \u0420\u0430\u0437 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0438\u0442\u044c \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u0430\u043a \u0431\u0430\u0439\u0442\u044b.<br \/>  2. \u0411\u0430\u0439\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u0438\u043c\u0435\u0442\u044c <b>upgrade<\/b> \u0444\u043e\u0440\u043c\u0443 (\u0442.\u043a. \u0441 UTF-8 \u0444\u043b\u0430\u0433\u043e\u043c). \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u043a\u0430\u043a \u0443 <b>downgrade<\/b> \u0444\u043e\u0440\u043c\u044b.<\/p>\n<p>  \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c <b>utf8::downgrade<\/b> \u0438 \u0432\u044b\u0434\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f.<\/p>\n<p>  \u0414\u043b\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432, \u0442\u0438\u043f\u0430 \u0445\u044d\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u043d\u0430 \u0437\u0430\u0431\u043e\u0442\u0430 \u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0414\u0435\u043b\u0430\u0442\u044c \u0432\u0442\u043e\u0440\u0443\u044e \u043a\u043e\u043f\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e, \u0442\u0430\u043a \u0447\u0442\u043e, \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0439 \u0435\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440.<\/p>\n<p>  \u041a\u0430\u043a, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u043c\u043d\u043e\u0433\u0438\u0435 \u0437\u043d\u0430\u044e\u0442, \u0432 Perl \u0432\u0441\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435, \u043d\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e.<\/p>\n<pre><code class=\"perl\">sub mycode {   $_[0] = &quot;X&quot;; # \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u043f\u0435\u0440\u0432\u044b\u0439 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0432\u043e\u043b\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0435\u0433\u043e } <\/code><\/pre>\n<pre><code class=\"perl\">sub mycode {   my ($arg1) = @_; # \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438   $arg1 = &quot;X&quot;; # \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e, \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043d\u0435 \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u0442\u0441\u044f } <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u0447\u043d\u043e \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439 Perl, \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043a\u043e\u0434, \u043d\u0435\u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0434\u0435\u043b\u0430\u044e\u0449\u0438\u0439 <b>utf8::downgrade<\/b> \u043d\u0430\u0434 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438, \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0432\u043e\u043b\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0435\u0433\u043e, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0441\u043e\u0437\u0434\u0430\u0432 \u0431\u0430\u0433 \u0432 \u043a\u0430\u043a\u043e\u043c-\u0442\u043e \u0434\u0440\u0443\u0433\u043e\u043c \u043c\u0435\u0441\u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u043e \u0441\u0442\u0440\u043e\u043a\u0438, \u0438 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u0445\u043e\u0440\u043e\u0448\u043e.<\/p>\n<h5>\u0414\u043b\u044f \u0438\u043c\u0451\u043d \u0444\u0430\u0439\u043b\u043e\u0432 \u0432\u0441\u0451 \u044d\u0442\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442<\/h5>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u0438\u043c\u0435\u043d\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u043a\u0430\u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b (<b>open<\/b>, \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0435 \u0442\u0435\u0441\u0442\u044b <b>-X<\/b>), \u0430 \u0442\u0430\u043a \u0436\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u0438\u043c\u0435\u043d\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 (<b>readdir<\/b>), \u043d\u0435 \u043f\u043e\u0434\u0447\u0438\u043d\u044f\u044e\u0442\u0441\u044f \u044d\u0442\u0438\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c (\u044d\u0442\u043e <a href=\"http:\/\/perldoc.perl.org\/perlunicode.html#When-Unicode-Does-Not-Happen\">\u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043e<\/a> \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438).<\/p>\n<p>  \u041e\u043d\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u044e\u0442 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430, \u043a\u0430\u043a \u043e\u043d\u043e \u0435\u0441\u0442\u044c \u0432 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<p>  \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"perl\">sub open {  my ( ... $filename) = @_;  utf8::_utf8_off($filename); # \u0442\u0435\u043f\u0435\u0440\u044c \u044d\u0442\u043e \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435  _open($filename); <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u0447\u0438\u043d:<\/p>\n<p>  1. \u0412\u043e \u043c\u043d\u043e\u0433\u0438\u0445 POSIX \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 ( Linux \/ *BSD ), \u043d\u0430 \u043c\u043d\u043e\u0433\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445, \u0438\u043c\u0435\u043d\u0435\u043c \u0444\u0430\u0439\u043b\u0430 \u043c\u043e\u0436\u0435\u0442 \u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u0430\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0431\u0430\u0439\u0442\u043e\u0432, \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u044f\u0432\u043b\u044f\u044e\u0449\u0430\u044f\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435.<br \/>  2. \u041d\u0435\u0442 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0443 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<br \/>  3. \u041d\u0430 \u043c\u0430\u0448\u0438\u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0441 \u0440\u0430\u0437\u043d\u043e\u0439 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u043e\u0439<br \/>  4. \u041d\u0435\u043b\u044c\u0437\u044f \u043e\u043f\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430 \u0438\u043c\u0451\u043d \u0444\u0430\u0439\u043b\u043e\u0432 \u0441\u043e\u0432\u043f\u0430\u0434\u0451\u0442 \u0441 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u043b\u043e\u043a\u0430\u043b\u0438.<br \/>  5. \u0414\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u043e \u0441\u0442\u0430\u0440\u044b\u043c \u043a\u043e\u0434\u043e\u043c.<\/p>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u0430\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0443 \u0438 \u0441\u043e\u043e\u0431\u0449\u0430\u0442\u044c \u0435\u0451 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0443, \u043d\u043e API \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0449\u0451 \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u043b\u0438.<\/p>\n<p>  \u041c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448 \u043f\u0440\u0438\u043c\u0435\u0440, \u0433\u0434\u0435 \u043c\u044b \u00ab\u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u00bb \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u043d\u0430 downgrade \u0441\u0442\u0440\u043e\u043a\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432.<\/p>\n<pre><code class=\"perl\">use strict; use warnings; use Digest::SHA qw\/sha1_hex\/; use utf8; my $s = &quot;\u00b5&quot;; my $s1 = $s; my $s2 = $s;  my $digest = sha1_hex($s2); # \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0440\u043e\u0447\u043a\u0443  print STDERR &quot;s1 and s2 are equal\\n&quot; if $s1 eq $s2;  open my $f, &quot;&gt;&quot;, &quot;$s1.tmp&quot; or die &quot;s1 failed: $!&quot;; print $f &quot;test&quot;; close $f;  open $f, &quot;&lt;&quot;, &quot;$s2.tmp&quot; or die &quot;s2 failed: $!&quot;; print STDERR &quot;Done\\n&quot;; <\/code><\/pre>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b:  <\/p>\n<pre> s1 and s2 are equal s2 failed: No such file or directory  <\/pre>\n<p>  \u0442.\u0435. \u0441\u0442\u0440\u043e\u043a\u0438 s1 \u0438 s2 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442, \u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u0435\u0441\u043b\u0438 \u0432\u044b\u0432\u043e\u0437 <b>sha1_hex<\/b> \u0443\u0431\u0440\u0430\u0442\u044c, \u0442\u043e \u043d\u0430 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0444\u0430\u0439\u043b\u044b.<\/p>\n<p>  \u041d\u0430 \u044d\u0442\u0438 \u0436\u0435 \u0433\u0440\u0430\u0431\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0442\u043a\u043d\u0443\u0442\u044c\u0441\u044f, \u043e\u0431\u0440\u0430\u0449\u0430\u044f\u0441\u044c \u043a \u043b\u044e\u0431\u044b\u043c \u043c\u043e\u0434\u0443\u043b\u044f\u043c, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u043c \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <b>File::Find<\/b>)<\/p>\n<h5>\u041a\u043e\u0433\u0434\u0430 \u0435\u0449\u0451 \u044d\u0442\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442<\/h5>\n<p>  \u0412 \u043c\u043e\u0434\u0443\u043b\u0435 Encode \u0415\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044f <a href=\"http:\/\/search.cpan.org\/~dankogai\/Encode-2.52\/Encode.pm#decode_utf8\">decode_utf8<\/a><br \/>  \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u043a\u0430\u043a:<\/p>\n<blockquote><p>Equivalent to $string = decode(\u00abutf8\u00bb, $octets [, CHECK])  <\/p><\/blockquote>\n<p>  \u041d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0435\u0441\u043b\u0438 \u0443 $octets \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0444\u043b\u0430\u0433 UTF-8, \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u0445 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u044b\u043c\u0438 (\u0445\u043e\u0442\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c <b>utf8::downgrade<\/b> \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0438\u043c\u0438, \u043a\u0430\u043a \u0441 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0430 \u0435\u0441\u043b\u0438 <b>downgrade<\/b> \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u0432\u044b\u0434\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443 <i>Wide characters<\/i>).<\/p>\n<p>  \u042d\u0442\u043e\u0442 \u0431\u0430\u0433 \u0431\u044b\u043b \u0437\u0430\u043c\u0435\u0447\u0435\u043d ( <a href=\"https:\/\/rt.cpan.org\/Public\/Bug\/Display.html?id=61671\">RT#61671<\/a> <a href=\"https:\/\/rt.cpan.org\/Public\/Bug\/Display.html?id=87267\">RT#87267<\/a> ) \u0441\u0440\u0430\u0437\u0443 \u043a\u0430\u043a \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u2014 \u0432 2010 \u0433\u043e\u0434\u0443.<\/p>\n<p>  \u041d\u043e \u043c\u0430\u0439\u043d\u0442\u0430\u0439\u043d\u0435\u0440 \u043e\u0442\u0432\u0435\u0440\u0433\u0430\u0435\u0442 \u0432\u0441\u0435 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0431\u0430\u0433\u0440\u0435\u043f\u043e\u0440\u0442\u044b. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u0443\u0442\u044c \u0440\u0435\u043f\u043e\u0440\u0442\u043e\u0432, \u0434\u0430\u0436\u0435 \u043d\u0435 \u0432 \u0442\u043e\u043c \u0447\u0442\u043e\u0431\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u0435\u043b\u0430 \u0441\u0435\u0431\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e (\u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0438\u0434\u0435\u0435\u0439 Perl), \u0438 \u0434\u0430\u0436\u0435 \u043d\u0435 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043a \u043d\u0435\u0439 \u0431\u044b\u043b\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0430\u044f \u044d\u0442\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e, \u0445\u043e\u0442\u044f \u0431\u044b, \u044d\u0442\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438. \u041c\u0430\u0439\u043d\u0442\u0430\u0439\u043d\u0435\u0440 \u0436\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u0442, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043a\u0430\u043a \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b\u0435, \u0430 \u044d\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u0447\u0438\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b\u0435 (\u0445\u043e\u0442\u044f \u043f\u043e\u043c\u043e\u0435\u043c\u0443 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u043a\u0430\u043a \u043f\u043e\u0445\u043e\u0436\u0435\u0441\u0442\u044c, \u0438 \u043a\u0430\u043a \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u044c). \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0435 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u044c \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0430\u0436\u0435 \u043d\u0430\u043c\u0451\u043a\u0430 \u043d\u0430 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u044c\u2026 \u0415\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0441\u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0437\u0433\u0430\u0434\u0430\u0442\u044c \u044d\u0442\u0443 \u0437\u0430\u0433\u0430\u0434\u043a\u0443, \u0431\u0443\u0434\u0443 \u043e\u0447\u0435\u043d\u044c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0435\u043d.<\/p>\n<h5>The Unicode Bug<\/h5>\n<p>  \u0412 <b>downgraded<\/b> \u0444\u043e\u0440\u043c\u0435 Latin-1 \u043d\u0435\u043b\u044c\u0437\u044f \u043e\u0442\u043b\u0438\u0447\u0438\u0442\u044c \u043e\u0442 \u0431\u0430\u0439\u0442\u043e\u0432, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0432 \u044d\u0442\u043e\u0439 \u0444\u043e\u0440\u043c\u0435, \u043f\u043b\u043e\u0445\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0435\u0442\u0430\u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0432 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445, \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <b>uc<\/b>, <b>lc<\/b>, <b>quotemeta<\/b>.<\/p>\n<p>  \u0412\u043e\u0440\u043a\u044d\u0440\u0430\u0443\u043d\u0434 \u2014 <b>utf8::downgrade<\/b>, \u043b\u0438\u0431\u043e, \u0432 \u043d\u043e\u0432\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 Perl \u2014 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u043d\u044b\u043c.<\/p>\n<p>  \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0432 <a href=\"http:\/\/perldoc.perl.org\/perlunicode.html#The-%22Unicode-Bug%22\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Perl<\/a><\/p>\n<h5>\u0427\u0442\u043e \u0436\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043e \u0432\u0441\u0435\u043c \u044d\u0442\u0438\u043c?<\/h5>\n<p>  1. \u041d\u0435 \u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c (\u0435\u0441\u043b\u0438 \u0432\u044b \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0435) \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438: <b>utf8::is_utf8<\/b>, <b>Encode::_utf8_on<\/b>, <b>Encode::_utf8_on<\/b>, \u0438 \u0432\u0441\u0435\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u044f <b>bytes<\/b> (\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043a\u043e \u0432\u0441\u0435\u043c \u044d\u0442\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442 \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435, \u043a\u0440\u043e\u043c\u0435 \u043a\u0430\u043a \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438)<\/p>\n<p>  2. \u041f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c <b>utf8::upgrade<\/b>,<b> utf8::downgrade<\/b>, \u0432\u0441\u044f\u043a\u0438\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e\u0433\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f Perl<\/p>\n<p>  3. \u0414\u043b\u044f \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u0438\u0437 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 \u0431\u0430\u0439\u0442\u044b \u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c <b>Encode::encode<\/b>, <b>Encode::decode<\/b><\/p>\n<p>  3. \u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0447\u0443\u0436\u043e\u0439 \u043a\u043e\u0434, \u043d\u0430\u0440\u0443\u0448\u0430\u044e\u0449\u0438\u0439 \u044d\u0442\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430, \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0435\u0433\u043e \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0431\u0430\u0433\u043e\u0432, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0439\u0442\u0435 workaround\u044b.<\/p>\n<p>  4. \u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u0444\u0430\u0439\u043b\u043e\u0432, \u043b\u0438\u0431\u043e \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c wrapper \u043d\u0430\u0434 \u0432\u0441\u0435\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438, \u043b\u0438\u0431\u043e, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0435\u0441\u0442\u043e\u0432 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u043c\u0451\u043d \u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u0434\u0430.<\/p>\n<p>  \u0415\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u043f\u0440\u0430\u0432\u0438\u043b \u043c\u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d\u043d\u044b\u043c.<\/p>\n<pre><code class=\"perl\">Encode::_utf8_off($_[0]) if utf8::is_utf8($_[0]) && (bytes::length($_[0]) == length($_[0])); <\/code><\/pre>\n<p>  (\u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0435\u0442 UTF-8 \u0444\u043b\u0430\u0433 \u0434\u043b\u044f ASCII-7bit \u0442\u0435\u043a\u0441\u0442\u0430 (\u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0443\u0434\u0430\u0451\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0438\u0447\u044c 30% \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0433\u044d\u043a\u0441\u043f\u043e\u0432, \u0432\u043e \u0432\u0441\u0435\u0445 Perl, \u043a\u0440\u043e\u043c\u0435 5.19)<\/p>\n<pre><code class=\"perl\">defined($_[0]) && utf8::is_utf8($_[0]) && (bytes::length($_[0]) != length($_[0])) <\/code><\/pre>\n<p>  (\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 TRUE, \u0435\u0441\u043b\u0438 \u0443 \u0441\u0442\u0440\u043e\u043a\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d UTF-8 \u0444\u043b\u0430\u0433, \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u043d\u0430 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f ASCII-7bit. \u041c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 unit \u0442\u0435\u0441\u0442\u0430\u0445, \u0447\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432\u0430\u0448\u0438 400 \u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0432 700)<\/p>\n<p>  \u0415\u0441\u0442\u044c \u0435\u0449\u0451 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c. \u0427\u0435\u0441\u0442\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u043f\u0440\u043e\u0439\u0434\u0451\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0432\u044b \u043d\u0430\u0442\u043a\u043d\u0451\u0442\u0435\u0441\u044c \u043d\u0430 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0431\u0430\u0433 (\u043d\u043e, \u043a \u0442\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443 \u0431\u0443\u0434\u0435\u0442 \u0443\u0436\u0435 \u043f\u043e\u0437\u0434\u043d\u043e). \u042d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/190584\/\"> http:\/\/habrahabr.ru\/post\/190584\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/204\/044\/55a\/20404455ac40f027b0b0fcd46c7fdea1.jpg\"\/><\/p>\n<p>  \u0420\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u043e\u0435 \u0437\u0430\u0431\u043b\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0441\u0442\u0440\u043e\u043a \u0431\u0430\u0439\u0442\u043e\u0432, \u0438\u043c\u0435\u044e\u0442 UTF-8 \u0444\u043b\u0430\u0433 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c.<br \/>  \u041c\u043d\u043e\u0433\u0438\u0435 \u0434\u043e\u0433\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f ASCII-7-bit, \u0442\u043e UTF-8 \u0444\u043b\u0430\u0433 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0432\u0430\u0436\u0435\u043d.<\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e, \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0438\u043b\u0438 \u0441\u0431\u0440\u043e\u0448\u0435\u043d, \u043a\u0430\u043a \u0438 \u0443 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0442\u0430\u043a \u0438 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0445 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-190584","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/190584","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=190584"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/190584\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=190584"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=190584"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=190584"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}