[Fribidi-discuss] DLL

Shachar Shemesh fribidi-discuss at sun.consumer.org.il
Thu Jan 23 04:17:02 EST 2003


Behdad Esfahbod wrote:

>Hi Shachar,
>
>Would you please guide this guy.
>
>behdad
>
Hi Nima and Behdad,

I'm afraid that I have never compiled FriBiDi on Windows, so a real help 
as far as compiling is beyond me. Just getting mingW and using it as 
usual is probably a good starting point.

What I can tell you is about the problems you are expected to encounter 
once you have compiled it. Windows uses UTF-16 for Unicode, which means 
that each Unicode characters takes two bytes unless agregation is used. 
FriBiDi (and Unix), on the other hand, use UCS-4, which mean each 
character takes 4 bytes, and there is no need for agregation.

If your windows apps are all ANSI, you are pretty much in the clear. 
Just use the existing fribidi interface to convert from ISO-8859-8 or 
ISO-8859-6 to UCS-4, and go on as usual from there. If your app is 
Unicode things are a little more complicated. If you don't want to write 
any extra code, the simplest route is to convert your unicode to Windows 
1255 or 1256, and then treat it like ISO-8859-8 or ISO-8859-6 respectively.

The cleaner but less paved way is to convert the UTF-16 string to UCS-4. 
If you can 100% guarentee that no Japanese and Chinese characters are 
there you MAY be able to get away with simply enhancing each 2 bytes to 
4 by means of zero padding (use at your own risk). I also wrote some 
code to perform the real conversion a while back (for wine), but
A. I'm not sure where it is at the moment. I'll have to dig it out.
B. It is LGPL, I'm not sure what that means for your app.
C. It is still buggy, as it was just a proof of concept code.

If you feel brave enough, you can dig it out of the wine-devel archives 
(http://www.winehq.org, search for messages by me), and debug/integrate it.

Also, there is some initiative, lead by me, to have FriBiDi support all 
encodings. I wouldn't wait for that to happen if I were you. The changes 
to the build system are pretty straightforward, but getting FriBiDi to 
compile after the changes is a real hard work. My work is further slowed 
down by the interface changes Behdad is planning for FriBidi, that will 
require a rewrite of my changes. I get even less incentive by the fact 
that trying to get my change in after Behdad's change will be easier 
than it is today.

So, unless you want to wait for Behdad to finish his interface change 
(BTW - are you working on it Behdad?), and then for me to put in the 
changes, your best bet is to either work as ANSI, or to do the conversions.

>
>PS.  Well, I'm still alive...
>  
>
That is comforting to hear at these troubled times.

            Shachar






More information about the FriBidi mailing list