[Debburn-devel] What can I assume about libc?

Lorenz Minder lminder at gmx.net
Wed Oct 4 22:15:21 UTC 2006


Hi,

Albert Cahalan wrote:
> >Yes. The problem is, if we have UTF-8 strings internally, it is a real
> >pain to do string processing with them; even replacing a given character
> >with another becomes a major pain. It seems much easier to use
> >mbstowcs() and then process these strings, and convert when we write
> >them to files. IOW, I'm not against writing UTF-8 to files, but I don't
> >think it is a reasonable in-core representation of strings if you want
> >to do anything at all with them.
> 
> Assuming we still care about Windows, mbstowcs() won't do.

I think we should care, although [1] suggests it's on the lists of
platforms to drop. I don't know what's actually the plan.

> I'm fairly sure that you end up with a mix of 2-byte and 4-byte
> characters

I had a look.  On Win32, wchar_t is actually 16 bit, so there's little
risk of getting 4-byte chars.  I do have the problem, though, that I
could not find any way to set UTF-8 encoding in Windows.  All you have
is codepages, or at least I did not find the UTF-8 "codepage", if
exists.

So yes, mbstowcs() won't do.

>Custom functions may be best:
> 
> utf8_to_u32
> u32_to_utf8
> u32_to_utf16
> utf16_to_u32

Or we can just use libiconv instead for this purpose, which apparently
also exists for Windows.

> >> (then again, kicking mkisofs out might be a better move)
> >
> >I think mkisofs is a pretty important program; in fact it is currently
> >my main reason for being interested in this project.
> 
> I also think it is a pretty important program. It doesn't need
> to ship with the CD burning drivers though.

That might be true. You have to access the drive for multisession, I
gather, so I'm not completely convinced that you don't need any of the
libscg parts there.

>Perhaps you would
> like to maintain it yourself, without the rest of the stuff.

I don't think this is a good idea.  I can't see who would actually
benefit if I did.

Best,
--Lorenz


[1] http://lists.alioth.debian.org/pipermail/debburn-devel/2006-September/000069.html



More information about the Debburn-devel mailing list