Home > Development, Rant > Adventures with Wine

Adventures with Wine

Usual warning: If you are not interested in computers you won’t find this post informative. If you are interested in computers, there is still a high probability of that. If you are a Wine user, you might be interested.

Before I switched to the new compiler to be able to use zkanji in a Unicode environment, the program worked with only smaller glitches under Wine. Unfortunately the switch brought forth some bugs that made the program freeze under Wine when it was started up. The bugs were not new, but for some reason the program compiled with the old compiler was not that sensitive to them. Non-programmers probably don’t know anything about “calling conventions”, but for those who do, this was for some reason changed between compiler versions, and even though I might have used the incorrect one for one of my functions, it worked fine before the switch. Unfortunately the bad calling convention caused zkanji to freeze under Wine, but also caused random errors on Windows as well.

I don’t know anything about how Wine handles the Windows registry, but it clearly doesn’t allow changing the autorun entries by default, and whenever the settings window was opened and closed, a friendly error message announced an error. I “solved” this bug by disabling the checkbox that is there to change whether zkanji runs automatically on system startup or not, whenever the corresponding entry was unreachable in the registry.

I was surprised that Japanese fonts were included with Wine, but because some fonts are hard-coded into the program (eg. the font for kana input boxes), those only showed up as boxes. I can’t understand why Wine doesn’t automatically map the default “MS Gothic” and “MS Mincho” fonts to their equivalents if they are not found in the system, but as it doesn’t, I had to find a workaround to this problem. First of all, if the default fonts are not found on the system, I select “VL Gothic” and “IPA Mincho” as a replacement, and the curiously called “Droid Sans Fallback” for non-Japanese fonts. If this fails, I can still select the first Japanese font I find. This way I can hopefully avoid problems with fonts in the future, but if that’s not the case, you can notify me about the problem.

Next step: Update Checking. After a long day of testing I found out, that the Unicode version of some winsock functions (mainly GetAddrInfoW) crashes the program running on Wine. It might also be responsible for a bug under XP, which doesn’t crash the program completely, but shows an error message on startup if automatic update checking is enabled (this is just a theory at the moment, but hopefully this is the cause). I don’t want to blame the creators of Wine (it’s an almost impossible feat they achieved by even writing something like that), and it might not be their fault that the Unicode winsocket simply doesn’t work, or maybe it works on almost every machine, but mine is an exception. But whatever the truth is, making a program that works perfectly under Wine is an art.

After yesterday’s release, let me announce zkanji v0.593. The only change is the reverted Update Checking to the non-Unicode implementation. This doesn’t change the functionality in any way, every Unicode improvements are still in the program. If you have already downloaded v0.591 and no error shows up on startup or when you are checking for updates, you don’t need to get the new version. (I haven’t uploaded this new version yet, but I will do it soon.)

I would like to ask the help of any Linux user out there who have Japanese support with SCIM on Linux. I have installed SCIM to be able to type Japanese (the default input method in KDE apparently only works with real Japanese keyboards…) and it worked fine until I decided to update my Firefox to the latest version. Now everything can get Japanese input, except Firefox. (I could write a few entries about my adventures with Linux, but I don’t want to offend anyone.)

Categories: Development, Rant Tags: ,
  1. Wineuser
    July 29, 2011 at 10:54 pm

    >the default input method in KDE apparently only works with real Japanese keyboards
    Haven’t used it, but i doubt that is the case. There is no IME that work with only one keyboard type.

    Can’t help with scim, i use uim.

    • July 29, 2011 at 11:03 pm

      There are extra buttons on a Japanese keyboard that let you switch between alphanumeric / kana input and some others that make converting easier, and those are missing from other keyboards. On windows there are key combinations (eg. right alt+caps lock) that can replace the missing keys, but those are not implemented on KDE. Even if there are similar combinations I haven’t found them nor any documentation that would mention those.

  2. July 30, 2011 at 5:08 pm

    I know that keys can be remapped but I have no idea how and I don’t have the energy to spend on configuring Linux. It always turns out to be hours unfortunately because things never work the way they are described in the manual. I appreciate the effort, so thanks.

  3. July 31, 2011 at 5:53 am

    SCIM is replaced by ibus (http://code.google.com/p/ibus/) on many distos recently.

    • August 2, 2011 at 2:18 pm

      Thanks, I have installed ibus and it works (for now).

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: