"Andrew Bachmann" <shatty@xxxxxxxxxxxxx> wrote: > Although you couldn't add a new character set without providing some > code > to perform the translation, there are some other modifications that > you could > make without needing to change the code. For example, providing new > aliases to existing character sets. Or providing a mime type for a > character > set that previously didn't have one. I don't think this makes putting that stuff into a file worth it. > Well, maybe some of my suggestion comes from my annoyance at having > to > code in the construction of the character set objects as well. The > character > set objects don't themselves have the code for doing the conversion, > (maybe > they should?) so they are just a bunch of int and char * fields. > Maybe a > little dabbling in initializers would simplify things. I'll try to > take another > look when I get a chance. Dunno, that should be determined by the libtextencoding.so implementation :) > BTW, we don't have any libtextencoding.so code in obos yet. And I'm > pretty sure the character set code should go in there instead of in > libtranslation.so. I think this lib implements only two exported > functions: Exactly, I just mixed it up (and I guess I am not the only one). > 00000a80 T convert_to_utf8(unsigned long, char const *, long *, char > *, long *, long *, char) > 00000e14 T convert_from_utf8(unsigned long, char const *, long *, > char *, long *, long *, char) > > Hmm... on the other hand I suppose it could cause a problem to > introduce > classes into libtextencoding.so because C code could link to it. > (right?) > Does this mean we should put the code somewhere else, restructure it > to > use C, or perhaps make a new lib for it? (libcharacterset.so?) No, that's no problem. You can easily call C++ functions from within C and vice versa. That's one reason why the C++ names are mangled so strange :) > BTW, I'm still not clear on whether or not we can use libiconv.so. > The > iconv package has a lib called libcharset.so also. IIRC iconv is part of glibc, and I thought about putting it into libroot.so as well, since the sprintf/sscanf implementation might rely on it (well see, but I should definitely pick that up again). Maybe we can augment libtextencoding.so to include iconv as well - that might be an almost clean solution. Adios... Axel.