The last few days ( weeks ) I’ve been working on some interesting aspects of internationalization under linux. Since the start of the semester I started the Bulgarian translation of Rasmol. Nothing interesting in this part, but when a Chinese and Japanese translations showed up, I had to modify the code for the menus to display the gliphs correctly. The problems were the following:
The graphical part of RasMol is using Xlib. No GTK nor QT. So in Xlib, in general, XDrawString and XDrawText are used to display text on the menus. Everything works OK until we start using east Asian languages. With them, a single glyph can be more than one byte, which causes rather interesting things to show up on the screen. Fortunately the Xlib devs have thought about that and have given us XmbDrawText and XmbDrawString but they work in a very different way. In order to display the gliphs on the screen, a list of fonts which can decode the text is needed, the LOCALE must be set correctly and the length of the decoded string must be calculated. Here comes XCreateFontSet - a method to create XFontSet structure required for XmbDraw*. OK, we have the tools but we need fonts, also the text must be in the correct encoding. We cannot just write all languages in UTF and try to display them ( UTF is not very well supported in Xlib regardless of the XwcDraw* functions ). We must encode every language in its own character set. Also since they are all in a single file, we cannot just use open->save to do the conversion, because it will mess up everything. We need to separate the languages, to encode them in the correct charset and to cat them in to the single file. Hopefully it works and here is the list of my 4 encodings:
iso8859-1 ( още известен като latin-1 ) за западно европейските езици
cp1251 ( aka windows-1251) for Cyrillic
cp936 for Chinese
eucjp ( euc-jisx0213, shift-jisx0213, sjis, ujis etc. ) for Japanese
so at the end we have 1 file from which it is impossible to display all languages at once correctly. Good thing there is iconv and the above procedure is not that hard. The hard part is to use the correct encoding< ->font< ->locale combination.
For myself I made a UTF8 version of that file and all languages can render perfectly in one singe file.
In the end we have Rasmol in English, Bulgarian, Spanish, Italian, French, Chinese, Russian and Japanese and they all show correctly under linux ( as well as windows after a few mods in the configs and a few restarts per language switch )
So I have to do some cosmetic changes and there it is.
—
I got an email from google a week ago ( exactly 1 month after their first email ) in which they thank me for the time and after carefully reviewing my experience and qualifications they decided that they do not have a strong match for me. It was going to be nice to gain some exp. @ google. I guess there were LOTS of applicants and some sources say that ppl from better schools have better chances, but I’m don’t know…
—
I’m going to get some food…
Robert Luciani
on 2007-03-14
Hi, I’m going to have a Google interview for the exact same position you applied for. They say that I will have two 45-minute technical interviews. I’m quite nervous and am wondering what kind of questions they asked you when you had your interview. I would _really_ appreciate it if you could just drop me a line at rluciani@gmail.com
thank you!
~Robert