[Flac-dev] reading vorbis comments with FLAC++?

Joshua Kwan joshk at triplehelix.org
Mon Nov 17 17:28:27 PST 2003


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?

> > > 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?

-- 
Joshua Kwan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
Url : http://lists.xiph.org/pipermail/flac-dev/attachments/20031117/df7175cc/attachment.pgp


More information about the Flac-dev mailing list