Michael B Allen writes:
> Can I statically link of the codepage headers (e.g. cp1252.h) from
> libiconv with an MIT Licensed module? I would not actually alter the
> file of course so a user could not modify the LGPL files in my module
> any more than if they had used libiconv directly.

Legally speaking: cp1252.h is code, not public header file. As long as
you don't distribute the resulting binaries/libraries, you can link it
with anything you want. If you want to distribute the result, however,
it must all fall under LGPL, which for binaries is roughly equivalent
to GPL. Namely, you must distribute the source of all the
binary/library.

Practically speaking: It is on purpose that linking with libiconv as a
shared library is encouraged, whereas linking it libiconv as a static
library is not so welcome. The reason is that some people in the
countries not yet well supported by character set standards (South
Asia an Africa, for example) should have an opportunity to adapt their
system to their needs.

> I need to be able to convert one character at a time and provide
> a subtitution character if the conversion is invalid or stop if some
> number of *characters* has been reached.

You can do that by using libiconv unmodified. There are even two ways
to do it:

1) You can make the conversion one character at a time, by offering
one input byte to iconv(), then two bytes, and so on. Kind of slow,
but works.

2) You can convert to an encoding where each character occupies a
fixed number of bytes, like UCS-4, and specify an output buffer of
precisely the size that can hold the number of characters that you
need.

Bruno
--
Linux-UTF8:   i18n of Linux on all levels
Archive:      http://mail.nl.linux.org/linux-utf8/

Reply via email to