<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:html="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>Cz::Sort</title>
</head>
<body>
<h1>Cz::Sort</h1>
<p>Czech sort</p>
<div>
<h2>Synopsis</h2>
<pre>use Cz::Sort;
my $result = czcmp("_x j&amp;á", "_&amp;p");
my @sorted = czsort qw(plachta plaňka Plánička plánička pláně);
print "@sorted\n";</pre>
</div>
<div>
<h2>Description</h2>
<p>Implements czech sorting conventions, indepentent on current locales in effect, which are often bad. Does the four-pass sort. The idea and the base of the conversion table comes from Petr Olsak's program <b>csr</b> and the code is as compliant with CSN 97 6030 as possible.</p>
<p>The basic function provided by this module, is <i>czcmp</i>. If compares two scalars and returns the (-1, 0, 1) result. The function can be called directly, like</p>
<pre>my $result = czcmp("_x j&amp;á", "_&amp;p");</pre>
<p>But for convenience and also because of compatibility with older versions, there is a function <i>czsort</i>. It works on list of strings and returns that list, hmm, sorted. The function is defined simply like</p>
<pre>sub czsort
        { sort { czcmp($a, $b); } @_; }</pre>
<p>standard use of user's function in <i>sort</i>. Hashes would be simply sorted</p>
<pre>@sorted = sort { czcmp($hash{$a}, $hash{$b}) }
                                        keys %hash;</pre>
<p>Both <i>czcmp</i> and <i>czsort</i> are exported into caller's namespace by default, as well as <i>cscmp</i> and <i>cssort</i> that are just aliases.</p>
<p>This module comes with encoding table prepared for ISO-8859-2 (Latin-2) encoding. If your data come in different one, you might want to check the module <b>Cstocs</b> which can be used for reencoding of the list's data prior to calling <i>czsort</i>, or reencode this module to fit your needs.</p>
</div>
<div>
<h2>Version</h2>
<p>0.68</p>
</div>
<div>
<h2>See also</h2>
<p>perl(1), Cz::Cstocs(3).</p>
</div>
<div>
<h2>Author</h2>
<p>
