| 1 |
wakaba |
1.1 |
<?xml version="1.0" ?> |
| 2 |
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 3 |
|
|
<html xmlns="http://www.w3.org/1999/xhtml"> |
| 4 |
|
|
<head> |
| 5 |
|
|
<title>Char::Normalize::FullwidthHalfwidth - Fullwidth/halfwidth character |
| 6 |
|
|
normalization</title> |
| 7 |
|
|
<link rel="stylesheet" href="http://suika.fam.cx/www/style/html/pod.css" type="text/css" /> |
| 8 |
|
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> |
| 9 |
|
|
<link rev="made" href="mailto:wakaba@suika.fam.cx" /> |
| 10 |
|
|
</head> |
| 11 |
|
|
|
| 12 |
|
|
<body> |
| 13 |
|
|
|
| 14 |
|
|
|
| 15 |
|
|
<!-- INDEX BEGIN --> |
| 16 |
|
|
<div name="index"> |
| 17 |
|
|
<p><a name="__index__"></a></p> |
| 18 |
|
|
|
| 19 |
|
|
<ul> |
| 20 |
|
|
|
| 21 |
|
|
<li><a href="#name">NAME</a></li> |
| 22 |
|
|
<li><a href="#synopsis">SYNOPSIS</a></li> |
| 23 |
|
|
<li><a href="#description">DESCRIPTION</a></li> |
| 24 |
|
|
<li><a href="#function">FUNCTION</a></li> |
| 25 |
|
|
<li><a href="#bugs">BUGS</a></li> |
| 26 |
|
|
<li><a href="#author">AUTHOR</a></li> |
| 27 |
|
|
<li><a href="#history">HISTORY</a></li> |
| 28 |
|
|
<li><a href="#license">LICENSE</a></li> |
| 29 |
|
|
</ul> |
| 30 |
|
|
|
| 31 |
|
|
<hr name="index" /> |
| 32 |
|
|
</div> |
| 33 |
|
|
<!-- INDEX END --> |
| 34 |
|
|
|
| 35 |
|
|
<p> |
| 36 |
|
|
</p> |
| 37 |
|
|
<h1><a name="name">NAME</a></h1> |
| 38 |
|
|
<p>Char::Normalize::FullwidthHalfwidth - Fullwidth/halfwidth character |
| 39 |
|
|
normalization</p> |
| 40 |
|
|
<p> |
| 41 |
|
|
</p> |
| 42 |
|
|
<hr /> |
| 43 |
|
|
<h1><a name="synopsis">SYNOPSIS</a></h1> |
| 44 |
|
|
<pre> |
| 45 |
|
|
use Char::Normalize::FullwidthHalfwidth qw/normalize_width/; |
| 46 |
|
|
|
| 47 |
|
|
$s = <>; |
| 48 |
|
|
normalize_width (\$s); |
| 49 |
|
|
print $s;</pre> |
| 50 |
|
|
<p> |
| 51 |
|
|
</p> |
| 52 |
|
|
<hr /> |
| 53 |
|
|
<h1><a name="description">DESCRIPTION</a></h1> |
| 54 |
|
|
<p>The <code>Char::Normalize::FullwidthHalfwidth</code> module provides a function |
| 55 |
|
|
that normalizes fullwidth/halfwidth compatibility characters into |
| 56 |
|
|
their canonical representations.</p> |
| 57 |
|
|
<p> |
| 58 |
|
|
</p> |
| 59 |
|
|
<hr /> |
| 60 |
|
|
<h1><a name="function">FUNCTION</a></h1> |
| 61 |
|
|
<p>This module provides a function, <a href="#normalize_width"><code>normalize_width</code></a>. It can be |
| 62 |
|
|
imported to a package by standard <code>Exporter</code> method, as:</p> |
| 63 |
|
|
<pre> |
| 64 |
|
|
use Char::Normalize::FullwidthHalfwidth qw/normalize_width/;</pre> |
| 65 |
|
|
<p>Note that the <code>use</code> statement does not export anything unless the |
| 66 |
|
|
function name was explicitly specified.</p> |
| 67 |
|
|
<p>Alternatively, you can invoke the function in its fully qualified form |
| 68 |
|
|
as:</p> |
| 69 |
|
|
<pre> |
| 70 |
|
|
require Char::Normalize::FullwidthHalfwidth; |
| 71 |
|
|
Char::Normalize::FullwidthHalfwidth::normalize_width (\$scalarref);</pre> |
| 72 |
|
|
<dl> |
| 73 |
|
|
<dt><strong><a name="normalize_width" class="item"><code>normalize_width ($scalarref)</code></a></strong> |
| 74 |
|
|
|
| 75 |
|
|
<dd> |
| 76 |
|
|
<p>Normalize the fullwidth/halfwidth characters in the scalar referenced |
| 77 |
|
|
by the argument into their preferable form. The argument must be a |
| 78 |
|
|
scalar reference. The scalar is treated as a character string |
| 79 |
|
|
(possibly with the utf8 flag set), not a byte string. The function |
| 80 |
|
|
returns the scalar reference.</p> |
| 81 |
|
|
</dd> |
| 82 |
|
|
<dd> |
| 83 |
|
|
<p>The function performs the following conversions:</p> |
| 84 |
|
|
</dd> |
| 85 |
|
|
<dl> |
| 86 |
|
|
<dt><strong><a name="space" class="item">A character <code>U+3000</code> <code>IDEOGRAPHIC SPACE</code> (so-called fullwidth space)</a></strong> |
| 87 |
|
|
|
| 88 |
|
|
<dd> |
| 89 |
|
|
<p>Replaced by a <code>U+0020</code> <a href="#space"><code>SPACE</code></a> (so-called halfwidth space) |
| 90 |
|
|
character.</p> |
| 91 |
|
|
</dd> |
| 92 |
|
|
</li> |
| 93 |
|
|
<dt><strong><a name="ff5e" class="item">Characters in the range <code>U+FF01</code>..<code>U+FF5E</code> (so-called fullwidth ASCII characters)</a></strong> |
| 94 |
|
|
|
| 95 |
|
|
<dd> |
| 96 |
|
|
<p>Replaced by a character in the range <code>U+0021</code>..<code>U+007E</code> (so-called |
| 97 |
|
|
halfwidth ASCII characters).</p> |
| 98 |
|
|
</dd> |
| 99 |
|
|
</li> |
| 100 |
|
|
<dt><strong><a name="ff9f" class="item">Characters in the range <code>U+FF61</code>..<code>U+FF9F</code> (halfwidth Katakana)</a></strong> |
| 101 |
|
|
|
| 102 |
|
|
<dd> |
| 103 |
|
|
<p>Replaced by a corresponding so-called fullwidth Katakana (or |
| 104 |
|
|
ideographic punctuation). Note that <code>U+FF9E</code> <code>HALFWIDTH KATAKANA |
| 105 |
|
|
VOICED SOUND MARK</code> and <code>U+FF9F</code> <code>HALFWIDTH KATAKANA SEMI-VOICED |
| 106 |
|
|
SOUND MARK</code> are replaced by <code>U+3099</code> <code>COMBINING KATAKANA-HIRAGANA |
| 107 |
|
|
VOICED SOUND MARK</code> and <code>U+309A</code> <code>COMBINING KATAKANA-HIRAGANA |
| 108 |
|
|
SEMI-VOICED SOUND MARK</code> respectively, not their spacing variants.</p> |
| 109 |
|
|
</dd> |
| 110 |
|
|
</li> |
| 111 |
|
|
<dt><strong><a name="ffe6" class="item">Characters in the range <code>U+FFE0</code>..<code>U+FFE6</code> (fullwidth symbols)</a></strong> |
| 112 |
|
|
|
| 113 |
|
|
<dd> |
| 114 |
|
|
<p>Replaced by a corresponding canonical character.</p> |
| 115 |
|
|
</dd> |
| 116 |
|
|
</li> |
| 117 |
|
|
</dl> |
| 118 |
|
|
</dl> |
| 119 |
|
|
<p> |
| 120 |
|
|
</p> |
| 121 |
|
|
<hr /> |
| 122 |
|
|
<h1><a name="bugs">BUGS</a></h1> |
| 123 |
|
|
<p>Not all compatibility characters in the fullwidth and halfwidth block |
| 124 |
|
|
of the Unicode Standard are currently supported - especially, |
| 125 |
|
|
halfwidth Hangul syllables are not converted to their fullwidth |
| 126 |
|
|
equivalents. A future version of this module is expected to address |
| 127 |
|
|
this issue by extending the conversion table.</p> |
| 128 |
|
|
<p> |
| 129 |
|
|
</p> |
| 130 |
|
|
<hr /> |
| 131 |
|
|
<h1><a name="author">AUTHOR</a></h1> |
| 132 |
|
|
<p>Wakaba <<a href="mailto:w@suika.fam.cx">w@suika.fam.cx</a>>.</p> |
| 133 |
|
|
<p> |
| 134 |
|
|
</p> |
| 135 |
|
|
<hr /> |
| 136 |
|
|
<h1><a name="history">HISTORY</a></h1> |
| 137 |
|
|
<p>This module was originally developed as part of SuikaWiki |
| 138 |
|
|
<a href="http://suika.fam.cx/~wakaba/wiki/sw/n/SuikaWiki">http://suika.fam.cx/~wakaba/wiki/sw/n/SuikaWiki</a>.</p> |
| 139 |
|
|
<p> |
| 140 |
|
|
</p> |
| 141 |
|
|
<hr /> |
| 142 |
|
|
<h1><a name="license">LICENSE</a></h1> |
| 143 |
|
|
<p>Copyright 2008 Wakaba <<a href="mailto:w@suika.fam.cx">w@suika.fam.cx</a>></p> |
| 144 |
|
|
<p>This program is free software; you can redistribute it and/or |
| 145 |
|
|
modify it under the same terms as Perl itself.</p> |
| 146 |
|
|
|
| 147 |
|
|
</body> |
| 148 |
|
|
|
| 149 |
|
|
</html> |