📄 ch15_03.htm
字号:
<html><head><title>Unicode (Programming Perl)</title><!-- STYLESHEET --><link rel="stylesheet" type="text/css" href="../style/style1.css"><!-- METADATA --><!--Dublin Core Metadata--><meta name="DC.Creator" content=""><meta name="DC.Date" content=""><meta name="DC.Format" content="text/xml" scheme="MIME"><meta name="DC.Generator" content="XSLT stylesheet, xt by James Clark"><meta name="DC.Identifier" content=""><meta name="DC.Language" content="en-US"><meta name="DC.Publisher" content="O'Reilly & Associates, Inc."><meta name="DC.Source" content="" scheme="ISBN"><meta name="DC.Subject.Keyword" content=""><meta name="DC.Title" content="Unicode"><meta name="DC.Type" content="Text.Monograph"></head><body><!-- START OF BODY --><!-- TOP BANNER --><img src="gifs/smbanner.gif" usemap="#banner-map" border="0" alt="Book Home"><map name="banner-map"><AREA SHAPE="RECT" COORDS="0,0,466,71" HREF="index.htm" ALT="Programming Perl"><AREA SHAPE="RECT" COORDS="467,0,514,18" HREF="jobjects/fsearch.htm" ALT="Search this book"></map><!-- TOP NAV BAR --><div class="navbar"><table width="515" border="0"><tr><td align="left" valign="top" width="172"><a href="ch15_02.htm"><img src="../gifs/txtpreva.gif" alt="Previous" border="0"></a></td><td align="center" valign="top" width="171"><a href="ch15_01.htm">Chapter 15: Unicode</a></td><td align="right" valign="top" width="172"><a href="ch16_01.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0"></a></td></tr></table></div><hr width="515" align="left"><!-- SECTION BODY --><h2 class="sect1">15.3. Caution, <img src="figs/ren2_bold.gif"> Working</h2><p>As of this writing (that is, with respect to version 5.6.0 of Perl),there are still some caveats on use of Unicode. (Check your online docsfor updates.)<a name="INDEX-2868"></a><a name="INDEX-2869"></a></p><ul><li><p> The existing regular expression compiler does notproduce polymorphic opcodes. This means that the determination ofwhether a particular pattern will match Unicode characters is madewhen the pattern is compiled (based on whether the pattern containsUnicode characters) and not when the matching happens at runtime. This needs to be changed to adaptively match Unicode if the string tobe matched is Unicode.</p></li><li><p> There iscurrently no easy way to mark data read from a file or other externalsource as being utf8. This will be a major area of focus in the nearfuture and is probably already fixed as you read this.</p></li><li><p> There is no method forautomatically coercing input and output to some encoding other thanUTF-8. This is planned in the near future, however, so check youronline docs.</p></li><li><p> Use of locales withutf8 may lead to odd results. Currently, there is some attempt toapply 8-bit locale information to characters in the range<tt class="literal">0..255</tt>, but this is demonstrably incorrect forlocales that use characters above that range (when mapped intoUnicode). It will also tend to run slower. Avoidance of locales isstrongly encouraged.</p></li></ul><p>Unicode is fun--you just have to define fun correctly.</p><!-- BOTTOM NAV BAR --><hr width="515" align="left"><div class="navbar"><table width="515" border="0"><tr><td align="left" valign="top" width="172"><a href="ch15_02.htm"><img src="../gifs/txtpreva.gif" alt="Previous" border="0"></a></td><td align="center" valign="top" width="171"><a href="index.htm"><img src="../gifs/txthome.gif" alt="Home" border="0"></a></td><td align="right" valign="top" width="172"><a href="ch16_01.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0"></a></td></tr><tr><td align="left" valign="top" width="172">15.2. Effects of Character Semantics</td><td align="center" valign="top" width="171"><a href="index/index.htm"><img src="../gifs/index.gif" alt="Book Index" border="0"></a></td><td align="right" valign="top" width="172">16. Interprocess Communication</td></tr></table></div><hr width="515" align="left"><!-- LIBRARY NAV BAR --><img src="../gifs/smnavbar.gif" usemap="#library-map" border="0" alt="Library Navigation Links"><p><font size="-1"><a href="copyrght.htm">Copyright © 2001</a> O'Reilly & Associates. All rights reserved.</font></p><map name="library-map"> <area shape="rect" coords="2,-1,79,99" href="../index.htm"><area shape="rect" coords="84,1,157,108" href="../perlnut/index.htm"><area shape="rect" coords="162,2,248,125" href="../prog/index.htm"><area shape="rect" coords="253,2,326,130" href="../advprog/index.htm"><area shape="rect" coords="332,1,407,112" href="../cookbook/index.htm"><area shape="rect" coords="414,2,523,103" href="../sysadmin/index.htm"></map><!-- END OF BODY --></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -