[FriBidi] FriBidi perl module doesn't work for me...

Behdad Esfahbod behdad at cs.toronto.edu
Mon Sep 26 07:36:36 PDT 2005


On Mon, 26 Sep 2005, Thurn, Martin wrote:

> Ok I got perl FriBidi working.  Thank you for your replies.  The trick
> is that the UTF-32 string sent to fribidi has to be LITTLE ENDIAN.  So,
> here is some sample code that WORKS:
>
> use Encode;
> use FriBidi;
> my $sLogical = 'imagine some UTF-8 Hebrew text here';
> Encode::from_to($sLogical, 'utf-8', 'UTF-32-LE');
> my ($sVisual, $sDirection) = &log2vis($sLogical);
> # Convert string back to Perl's internal representation:
> my $sVisual = Encode::decode('UTF-32-LE', $sVisual);
> # Now you can insert $sVisual into a Tk Text widget, for example
> __END__

Cool.  But note, FriBidi works on machine-endian.  Not LE.
Simply converting to 'UTF-32' doesn't work, but 'UTF-32-LE' does?
Weird.


>  - - Martin
--behdad
http://behdad.org/


More information about the fribidi mailing list