Dear Werner,
On Sun, 11 Dec 2005, Werner LEMBERG wrote:
Thanks. Note that I don't like libutf-8 (besides licensing issues see
http://jamesthornton.com/linux/HOWTO/Unicode-HOWTO-6.html). Instead,
I want handling of UTF-8 completely in gpreconv.
Drawbacks:
Non-standard API.
- Not an issue.
We call one function once.
UTF-8 is compiled in, not optional. Programs compiled with this library
lose support for the 8-bit encodings which are still frequently used in
Europe.
- Again not an issue.
We use it not for all input-output, but just for UTF.
Installation is nontrivial: Makefile needs tweaking, not autoconfiguring.
- No problem at all. No need to install and link against.
Just #input one source file.
This way an UTF converter independent of any external conversion library
can be made quickly. See attached file.
But licensing issues are your turf,
I have nothing to say about that.
Sincerely, Micahil
#include <stdio.h>
#include <stdlib.h>
#include "libutf-8-1.0/fget.utf-8.c"
int main()
{
unsigned int c;
while((c=fgetu8(stdin))!=EOF) {
if (c!=INVALID) {
if (c<=0x7f) {
putchar(c);
} else {
printf("\\[u%04X]",c);
}
}
else {
fputs("Error decoding UTF-8\n",stderr);
exit(1);
}
}
exit(0);
}
_______________________________________________
Groff mailing list
Groff@gnu.org
http://lists.gnu.org/mailman/listinfo/groff