aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: Problem with some GeoIP flags when the system language is Turkish  (Read 5200 times)

gagar

  • Approved Newbie
  • *
  • Karma: 2
  • Offline Offline
  • Posts: 28

Hi,

I think I remarked some weird bug in the way country flags are displayed when aMule (2.2.6 under Ubuntu 10.04.3 amd64) uses the Turkish language. The country is properly detected from the GeoIP data, but  there seems to be a character mapping issue with the country code which prevents the flag from being displayed properly. This specifically happens with country codes including the letter "I", such as "it" or "il" (please see the attached screenshot and note that the country codes are displayed erroneously, as "ıt" or "ıl" whereas they should be "it" and "il").

The thing is that in Turkish there's the "i" letter, which, in capitalized form, is written as "İ" (note that the dot is preserved). That's the usual "i" we all use. And then there's "ı", the "i without the dot", which, when capitalized, gives "I", which looks like the usual capital i in all Roman scripts. The trick is that in Turkish it's considered the capital form of "ı". So we have "I, ı and  İ, i". There's a much better  and detailed explanation on Wikipedia.

So my hypothesis is that at some point, the aMule thinks that "I" is an "i" whereas it's in fact a different letter, the "ı".  Which in turn prevents the flag from being displayed.

PS: If the problem indeed originates from a confusion between these two letters, it really should be limited to that "i without the dot case" as this letter is only found in Turkish and in some other Turkic languages (and in Irish). And there are no other similar funky cases in the Turkish alphabet.
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: Problem with some GeoIP flags when the system language is Turkish
« Reply #1 on: December 22, 2011, 10:49:34 PM »

Your hypothesis is totally correct. Problem was, GeoIP returns uppercase country codes, flag codes are lowercase, and wxString::MakeLower() fails in Turkish, converting 'I' to 'ı' instead of 'i'.
Fixed in SVN 10697. Not pretty, but working.  :-\
(now I'm fumbling inside a Turkish looking aMule trying to return it to something I can read...  ;) )
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

gagar

  • Approved Newbie
  • *
  • Karma: 2
  • Offline Offline
  • Posts: 28
Re: Problem with some GeoIP flags when the system language is Turkish
« Reply #2 on: December 23, 2011, 12:19:21 AM »

Your hypothesis is totally correct. Problem was, GeoIP returns uppercase country codes, flag codes are lowercase, and wxString::MakeLower() fails in Turkish, converting 'I' to 'ı' instead of 'i'.
Fixed in SVN 10697. Not pretty, but working.  :-\
Great, thank you. Do you think it would make sense to file a bug upstream? I'd happily do it but first I'd like to avoid filing a duplicate bug and second, I'm part of  the 99%. But you... you're different, you speak C++ so you can explain the problem much better than me and possibly submit a patch. You could save lives by doing so, honest!
Quote
(now I'm fumbling inside a Turkish looking aMule trying to return it to something I can read...  ;) )
Heh, that was my favourite game once upon a time: pick a mobile phone, switch it to Turkish and have fun looking at the other guy. This new variant is fun, too :P
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: Problem with some GeoIP flags when the system language is Turkish
« Reply #3 on: December 23, 2011, 12:02:10 PM »

Chinese works even better.  :)

Do you think it would make sense to file a bug upstream?
With Ubuntu? Rather not.
Mind, 2.2.6 is obsolete. 2.3.1 is current release, and it's not yet in Ubuntu. And this patch will be in 2.3.2 or 2.4, we haven't planned a new release yet. 2.4 will not happen for a while, and 2.3.2 only if something critical comes up.

I suggest you build current SVN for yourself, see here.
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

gagar

  • Approved Newbie
  • *
  • Karma: 2
  • Offline Offline
  • Posts: 28
Re: Problem with some GeoIP flags when the system language is Turkish
« Reply #4 on: December 23, 2011, 12:25:14 PM »

About upstream I was thinking to WxWidgets folks (since they seem to manage the wxString class) so that the report benefits more people.
Quote
I suggest you build current SVN for yourself, see here.
I'll try that. After all the world ends in 2012, right?
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: Problem with some GeoIP flags when the system language is Turkish
« Reply #5 on: December 23, 2011, 02:15:50 PM »

This isn't a wx bug. Problem is we are trying to perform a case conversion of a non-Turkish text ('IT') in Turkish localization. This can only fail.
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon