On Wed, 21 Aug 2002, Dekel Tsur wrote: > Since you use getISOEncoded for keyboard handling, I think that > char getISOEncoded(int c, Encoding & enc)
Yes, this is the best option, but it requires changing the rest of the code as well, because you have to introduce the Encoding. That's a good thing, and at some point, we should do that. We didn't do that in Porto, because we had to take small steps, and there is only so much time. > Or, you can add a simple unicode->8bit method to the Encodings class: > char Encoding::to8bit(int c) > { > if (c < 256 && encoding_table[c] == c) > return c; > for (int i = 0; i < 256; ++i) > if (encoding_table[i] == c) > return i; > return 0; > } > > and then getISOEncoded is just to return enc.to8bit(c). Yeah, that will also work great. Greets, Asger