Skip to content

Commit

Permalink
* Update SYNOPSIS and switch to public domain (CC0).
Browse files Browse the repository at this point in the history
  • Loading branch information
audreyt committed May 13, 2012
1 parent 32b8133 commit a043dc7
Show file tree
Hide file tree
Showing 21 changed files with 2,330 additions and 691 deletions.
11 changes: 11 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
[Changes for 1.31 - 2012-05-13]

* Clarify that $EastAsianWidth needs to be set at BEGIN time in
POD and tests for Perl 5.16+; no functional changes.

* LICENSING CHANGE: This compilation and all individual files in it
are now under the nullary CC0 1.0 Universal terms:

To the extent possible under law, 唐鳳 has waived all copyright and
related or neighboring rights to selfvars.

[Changes for 1.30 - 2007-02-08]

* Added miss-parsed lines of ranges in EastAsianWidth.txt, affecting
Expand Down
42 changes: 25 additions & 17 deletions META.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
---
abstract: East Asian Width properties
author:
- Audrey Tang <cpan@audreyt.org>
---
abstract: 'East Asian Width properties'
author:
- '唐鳳 <cpan@audreyt.org>'
build_requires:
ExtUtils::MakeMaker: 6.62
configure_requires:
ExtUtils::MakeMaker: 6.62
distribution_type: module
generated_by: Module::Install version 0.68
license: mit
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.3.html
version: 1.3
dynamic_config: 1
generated_by: 'Module::Install version 1.04'
license: unrestricted
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
module_name: Unicode::EastAsianWidth
name: Unicode-EastAsianWidth
no_index:
directory:
no_index:
directory:
- inc
- t
provides:
Unicode::EastAsianWidth:
file: lib/Unicode/EastAsianWidth.pm
version: 1.30
requires:
requires:
perl: 5.6.0
version: 1.30
resources:
homepage: http://github.com/audreyt/Unicode-EastAsianWidth/tree
repository:
type: git
url: git://github.com/audreyt/Unicode-EastAsianWidth.git
web: http://github.com/audreyt/Unicode-EastAsianWidth/tree
version: 1.31
9 changes: 1 addition & 8 deletions Makefile.PL
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
#!/usr/bin/perl

use strict;
use inc::Module::Install;
use inc::Module::Package 'Au:dry 1';

my $DefaultVersion = 'v5.0.0';
my $DefaultDate = '2006-02-15';

_build_pm();

name 'Unicode-EastAsianWidth';
all_from 'lib/Unicode/EastAsianWidth.pm';

auto_provides;
sign; WriteAll;

sub _build_pm {
my $file;

Expand Down
69 changes: 28 additions & 41 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,22 @@ VERSION
SYNOPSIS
use Unicode::EastAsianWidth;

$_ = chr(0x2588); # FULL BLOCK, an ambiguous-width character
$_ = chr(0x2010); # HYPHEN, an ambiguous-width character

/\p{InEastAsianAmbiguous}/; # true
/\p{InFullwidth}/; # false
/\p{InEastAsianAmbiguous}/; # True
/\p{InFullwidth}/; # False

{
local $Unicode::EastAsianWidth::EastAsian = 1;
/\p{InFullwidth}/; # true; only works on perl 5.8+
}
To mark ambiguous-width characters as InFullwidth:

BEGIN { $Unicode::EastAsianWidth::EastAsian = 1; }
use Unicode::EastAsianWidth;

$_ = chr(0x2010); # HYPHEN, an ambiguous-width character
/\p{InFullwidth}/; # True

DESCRIPTION
This module provide user-defined Unicode properties that deal with East
Asian characters' width status, as specified in
This module provide user-defined Unicode properties that deal with width
status of East Asian characters, as specified in
<http://www.unicode.org/unicode/reports/tr11/>.

It exports the following functions to the caller's scope, to be used by
Expand All @@ -34,44 +37,28 @@ DESCRIPTION

*Ambiguous* characters are treated by default as part of "InHalfwidth",
but you can modify this behaviour by assigning a true value to
$Unicode::EastAsianWidth::EastAsian.

CAVEATS
Setting $Unicode::EastAsianWidth::EastAsian at run-time only works on
Perl version 5.8 or above. Perl 5.6 users must use a BEGIN block to set
it before the "use" statement:
$Unicode::EastAsianWidth::EastAsian at compile time within a "BEGIN"
block before loading this module:

BEGIN { $Unicode::EastAsianWidth::EastAsian = 1 }
use Unicode::EastAsianWidth;

Setting $Unicode::EastAsianWidth::EastAsian at run-time used to work on
Perl versions between 5.8 and 5.14 due to an implementation detail, but
it will no longer work on Perl 5.16 and later versions, and hence is not
recommended.

SEE ALSO
perlunicode, <http://www.unicode.org/unicode/reports/tr11/>

AUTHORS
Audrey Tang <cpan@audreyt.org>

COPYRIGHT
Copyright 2002, 2003, 2007 by Audrey Tang <cpan@audreyt.org>.

This software is released under the MIT license cited below.

The "MIT" License
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
唐鳳 <cpan@audreyt.org>

CC0 1.0 Universal
To the extent possible under law, 唐鳳 has waived all copyright and
related or neighboring rights to Unicode-EastAsianWidth.

This work is published from Taiwan.

<http://creativecommons.org/publicdomain/zero/1.0>

71 changes: 71 additions & 0 deletions README.mkdn
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# NAME

Unicode::EastAsianWidth - East Asian Width properties

# VERSION

This document describes version 1.10 of Unicode::EastAsianWidth,
released October 14, 2007.

# SYNOPSIS

use Unicode::EastAsianWidth;

$_ = chr(0x2010); # HYPHEN, an ambiguous-width character

/\p{InEastAsianAmbiguous}/; # True
/\p{InFullwidth}/; # False

To mark ambiguous-width characters as InFullwidth:

BEGIN { $Unicode::EastAsianWidth::EastAsian = 1; }
use Unicode::EastAsianWidth;

$_ = chr(0x2010); # HYPHEN, an ambiguous-width character
/\p{InFullwidth}/; # True

# DESCRIPTION

This module provide user-defined Unicode properties that deal with
width status of East Asian characters, as specified in
[http://www.unicode.org/unicode/reports/tr11/](http://www.unicode.org/unicode/reports/tr11/).

It exports the following functions to the caller's scope, to be
used by Perl's Unicode matching system: `InEastAsianFullwidth`,
`InEastAsianHalfwidth`, `InEastAsianAmbiguous`, `InEastAsianNarrow`
`InEastAsianWide`, `InEastAsianNeutral`.

In accord to TR11 cited above, two additional context-sensitive properties
are exported: `InFullwidth` (union of `Fullwidth` and `Wide`) and
`InHalfwidth` (union of `Halfwidth`, `Narrow` and `Neutral`).

_Ambiguous_ characters are treated by default as part of
`InHalfwidth`, but you can modify this behaviour by assigning
a true value to `$Unicode::EastAsianWidth::EastAsian` at compile time
within a `BEGIN` block before loading this module:

BEGIN { $Unicode::EastAsianWidth::EastAsian = 1 }
use Unicode::EastAsianWidth;

Setting `$Unicode::EastAsianWidth::EastAsian` at run-time used to
work on Perl versions between 5.8 and 5.14 due to an implementation
detail, but it will no longer work on Perl 5.16 and later versions,
and hence is not recommended.

# SEE ALSO

[perlunicode](http://search.cpan.org/perldoc?perlunicode),
[http://www.unicode.org/unicode/reports/tr11/](http://www.unicode.org/unicode/reports/tr11/)

# AUTHORS

唐鳳 <cpan@audreyt.org>

# CC0 1.0 Universal

To the extent possible under law, 唐鳳 has waived all copyright and related
or neighboring rights to Unicode-EastAsianWidth.

This work is published from Taiwan.

[http://creativecommons.org/publicdomain/zero/1.0](http://creativecommons.org/publicdomain/zero/1.0)
Loading

0 comments on commit a043dc7

Please sign in to comment.