Hi Kai-Uwe, Neat trick. I am including it in my sources, thanks!
Regards Marti. On 15/09/2007 20:54:36, Kai-Uwe Behrmann ([EMAIL PROTECTED]) wrote: > Marti, > > in cmsio1.c:1507 lcms bails out if wcstombs returns with -1, as is the > case for the mentioned profile. > > I tested on x86 linux with libc-2.5. In return of ReadEmbeddedTextTag the > > strlen is zero. Probably the glibc implementation is weak, and lcms needs > > a work around to wcstombs. > > something like (?): > > 1504 i = wcstombs(Name, wchar, size_max ); > 1505 if (i == ((size_t) -1)) { > 1506 // second try at least for latin > 1507 int i; > 1508 char *tmp = (char*)wchar; > 1509 for(i = 0; i < Len/2; ++i) > 1510 Name[i] = tmp[i*2]; > 1511 //Name[0] = 0; // Error > 1512 } > > A check to ignore multibyte characters would be needed in addition: > > /* > * Index into the table below with the first byte of a UTF-8 sequence to > * get the number of trailing bytes that are supposed to follow it. > * Note that *legal* UTF-8 values c ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user