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

Josh Coalson xflac at yahoo.com
Tue Jan 25 12:46:19 PST 2005


--- Josh Coalson <xflac at yahoo.com> wrote:
> --- Joshua Kwan <joshk at triplehelix.org> 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.

forgot to mention, a few weeks back I checked in changes to
the metadata APIs so that trailing NULs are maintained everywhere.
i.e. any Vorbis comment entry, name, or value string returned
from the library will always have a terminating NUL, and entries/
values/strings passed in without terminating NULs will have them
added internally by the library.

note that the trailing NULs are not stored in the actual stream,
they are just a programming convenience for dealing with comments
whose semantics are NUL-terminated.

this will be in the upcoming release.  more info in the changelog:

http://cvs.sourceforge.net/viewcvs.py/*checkout*/flac/flac/doc/html/changelog.html?rev=HEAD

Josh


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Flac-dev mailing list