In our previous episode, Hans-Peter Diettrich said: > > utf8/16 -> ansi are a bit more involved. (since mapping many chars to few, > > naieve implementation requiring large lookupsets) > > A single 256 element array can be used for both directions. In Ansi to > Unicode the char value is used to index the array of Unicode values, > otherwise the given Unicode value is searched in the array.
That is an option also of course, but O(n). Probably the better solution is what was mentioned before, have a set of ranges and smaller lookuptables for these ranges. This lowers the set size at the expense of a few (constant time) comparisons. _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel