Re: dealing with utf8 filenames



On Tue, 2006-02-21 at 16:25, Tor Lillqvist wrote:
 > Also, I don't think the string returned from g_utf8_casefold() is
 > guaranteed to be the same length as the original, so my calculation
 > for string length is incorrect.

Umm, no? You look at the casefolded string and calculate the length of
the part up to the '.' of that?

Yes, that's what I'm doing. No, I don't think it's correct.

I am finding the extension in the case folded string and using that byte
offset to select the string length from the original string.

It could only be correct if the case folded string is guaranteed to be
the same length in bytes as the original string. For ASCII, that's
pretty likely. I'm not so sure about other types of characters. Perhaps
I'm wrong about that.

Is there a guaranteed correct way to do that?





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]