RE: FriBidi perl module doesn't work for me...

Behdad Esfahbod <[email protected]>
Newsgroups gmane.comp.internationalization.fribidi
Message-ID <[email protected]>
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/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.