RE: FriBidi perl module doesn't work for me...
"Thurn, Martin" <[email protected]>
| Newsgroups | gmane.comp.internationalization.fribidi |
|---|---|
| Message-ID | <[email protected]> |
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__
- - Martin