Subject: SV: i18n of abiword
From: Henrik Berg (henrik@lansen.se)
Date: Sat Jan 15 2000 - 14:59:33 CST
I found the translationtables (lesson, look first, write socond)
Sorry to say it, but this must be REALY slow way to do this.
U16 Convert1251ToUnicode(U16 char8)
{
switch (char8)
{
case 0x80:
return(0x0402); /* #CYRILLIC CAPITAL LETTER DJE */
case 0x81:
return(0x0403); /* #CYRILLIC CAPITAL LETTER GJE */
...
case 0xFE:
return(0x044E); /* #CYRILLIC SMALL LETTER YU */
case 0xFF:
return(0x044F); /* #CYRILLIC SMALL LETTER YA */
default:
return(char8);
}
}
Is there some reason, not to do it like this? One addition instead of upp to 128 itterations in the switch.
U16 Convert1251ToUnicode(U16 char8)
{
U16 table[] = {0x0402,0x0403, ..., 0x044E, 0x044F};
if(char8<0x80)
return char8;
return table[char8];
}
Could I change this and add a set of ConvertUnicodeTo12NN? I have not fully understood the relation of wv in the source tree.
--hb
This archive was generated by hypermail 2b25 : Sat Jan 15 2000 - 15:02:47 CST