--- Joshua Kwan <[EMAIL PROTECTED]> wrote: > On Mon, Nov 17, 2003 at 11:10:58AM -0800, Josh Coalson wrote: > > > but there's still junk on the char* i get back from > > > get_field_value(). > > > > there's no terminating null for these routines either, they > > are returning the unterminated UTF-8 buffer just like the C > > API. > > OK. I assumed that stuff passed back to the user as char* would have > been made to behave like a normal C string. > > > it's hard to do that without dealing with encodings right in the > > metadata API. > > What about making them return wchar_t* and thus IMPLYING to the user > that they have to do something about character conversion?
wchar_t still means converting to ucs-2 in the metadata library. that's not nearly as bad as dealing with multiple encodings, but it's independent of the question of whether or not to null- terminate. returning char* or wchar_t* don't in and of themselves imply that you're getting a null-terminated C string. > > > > char str[entry->length+1]; > > > > memcpy(str, entry->entry); > > > > str[entry->length] = '\0'; > > > > > > That's about the size of what I've been doing. > > > > and that's working, right? (or at least it will for ASCII > > tags) > > Yes. To convert, would i use iconv() or something like that? yes, see the plugin code I mentioned before for examples. Josh __________________________________ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ Flac-dev mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/flac-dev
