Locale::Hebrew - Bidirectional Hebrew support


Locale-Hebrew documentation Contained in the Locale-Hebrew distribution.

Index


Code Index:

NAME

Top

Locale::Hebrew - Bidirectional Hebrew support

VERSION

Top

This document describes version 1.05 of Locale::Hebrew, released May 27, 2010.

SYNOPSIS

Top

    use Locale::Hebrew;
    $visual = hebrewflip($logical);

DESCRIPTION

Top

This module is based on code from the Unicode Consortium.

The charset on their code was bogus, therefore this module had to work the real charset from scratch. There might have some mistakes, though.

One function, hebrewflip, is exported by default.

NOTES

Top

The input string is assumed to be in iso-8859-8 encoding by default.

On Perl version 5.8.1 and above, this module can handle Unicode strings by transparently encoding and decoding it as iso-8859-8. The return value should still be a Unicode string.

SEE ALSO

Top

Text::Bidi, which implements related algorithms based on the fribidi library.

ACKNOWLEDGMENTS

Top

Lots of help from Raz Information Systems, http://www.raz.co.il/.

Thanks to Oded S. Resnik for suggesting Unicode support and exporting hebrewflip by default.

AUTHORS

Top

Audrey Tang <cpan@audreyt.org> is the current maintainer.

Ariel Brosh <schop@cpan.org> is the original author, now passed away.

COPYRIGHT

Top


Locale-Hebrew documentation Contained in the Locale-Hebrew distribution.
package Locale::Hebrew;

use 5.005;
use strict;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
use Exporter;
use DynaLoader;
use AutoLoader;

@ISA = qw(Exporter DynaLoader);
@EXPORT = @EXPORT_OK = qw(hebrewflip);
$VERSION = '1.05';

__PACKAGE__->bootstrap($VERSION);

sub hebrewflip ($) {
    if ($] >= 5.008001 and utf8::is_utf8($_[0])) {
        require Encode;
        return Encode::decode(
            'iso-8859-8',
            _hebrewflip( Encode::encode('iso-8859-8', $_[0]) )
        );
    }
    goto &_hebrewflip;
}

1;

__END__
# Local variables:
# c-indentation-style: bsd
# c-basic-offset: 4
# indent-tabs-mode: nil
# End:
# vim: expandtab shiftwidth=4: