[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: Unicode keystrokes



On Wednesday 13 December 2006 00:00, Jens Granseuer wrote:
> On 12.12.2006 23:47, Jens Granseuer wrote:
> > On 12.12.2006 09:55, Nikola Smolenski wrote:
> > > And now, for something completely different.
> > >
> > >> I translated basic strings to Serbian, however the game had problems
> >
> > with> Cyrillic. So, here is the translation and a patch which solves the
> > problems> (to see the problems, just see the translation without the
> > patch).
> >
> > You should remove the revision marker from your translation and rather
> > add a noting saying which reveision of the base (ie. 'en') file you used
> > to create it.

OK.

> > > Description of the patch: I introduced new variable in class Widget
> >
> > called> 'keypos' which contains the position of the highlighted key. As
> > additional> advantage, it will highlight exactly that key, so, for
> > example, (mad up)> strings:
> > [...]
> >
> > > will be displayed correctly.
>
> Please use diff -u (and -p if your version supports it) when creating
> diffs.

OK, though I believe I used it?

> > I then made a new function called 'ASCIIEquivalent', which returns -
> > well, see
> > the description. If it is needed, in the same way non-ASCII characters
> > for French, German, Polish, Slovak etc. could be introduced.
>
> The ASCIIEquivalent function is desperately in need of some comments. I
> don't know Cyrillic, and I don't understand the algorithm used to get
> those ASCII representatives. I could probably do so if I studied some
> ASCII and Unicode tables, but it'd be nice if I didn't have to.
> Apart from that, this function should be added to the StringUtil class
> instead of Widget.

I added thorough comments and moved it to StringUtil.

> That said, I worked on Unicode support for key strokes a while back (and
> I even have a patch), but I took a different road because e.g. many
> (well, all, rather) German umlauts are actually available on my keyboard,
> so I don't need to use a for ä, for example, and the same is probably
> true of other languages as well. We'll need to see how that fits together.

This remains unsolved problem on Linux in general (and it's probably even 
worse on PDAs). Long story short, it is likely that someone who uses a 
Cyrillic language will use Latin keyboard. Ideally, programs should accept 
both Cyrillic character and its Latin equivalent.

And, I don't think that CF supports German umlauts either. I tried by typing 
in a file name on save game dialog and it seems that it accepts nothing but 
pure ASCII.

> Also, are you sure that only Chinese uses more than 2 bytes for
> representing a character? Otherwise we may need a proper UTF-8 decoder.

Well, no, Chinese is only typical example. Devanagari already uses 3 bytes, 
and so do various East Asian scripts, Chinese, Japanese, Korean... I haven't 
seen much translations into languages which use these scripts so I believe 
it's not a priority.

Attachment: crimson_serbian1.tar.bz2
Description: application/tbz