[vorbis] vorbiscomment question.

Beni Cherniavksy cben at techunix.technion.ac.il
Tue Aug 27 10:32:37 PDT 2002



On 2002-08-23, xdfisl wrote:

> > There is no round-tripping problem with --raw regarding character
> > sets. The problem is with delimiting comments.  Vorbis comment names
> > are limited but the content can contain any characters, including =,
> > line endings and even zero charcodes (IIRC).
>
> Okay, so --raw makes round-tripping okay for weird and non-standard
> characters but the problem with line endings is still present
> regardless of whether you specify --raw or not?
>
Exactly.  It can't go away without introducing some quoting
mechanism (because the comment can contaqin anything, even zero bytes...).

Now, since vorbiscomment is very useful in a unix enviroment in
combination with line-based tools like grep, I believe it's best
to quote the newlines in a comment so it all fits on one line.

One possible syntax is the obvoius '\','n' sequence for a newline and
'\','\' for a single backslash.  This has slight chance of comment
mutation when working with older tools.  Still, enabling this by default
is reasonable IMHO (but for one problem: loss of readability when invoked
from command line - would some --noquote option be that hard to type?).
I'll try to write a patch in the next days.  Side effect: users of
single-line vorbiscomment frontends will be able to type `\n' ;-)

Another, arguably simpler (1 to 1 char translation), way is to replace
newlines by character 255, which is illegal in UTF-8.  This is even nicer
for unix processing (think tr, etc.) but it is only good with --raw (not a
big problem, you should use --raw anyway ;-) and it could choke utf-8
parsers of unprepared apps.  Should this be an option too?

BTW, there are several line separators, especially with unicode, see

http://www.xiph.org/archives/vorbis-dev/200108/0233.html

Only the raw \n needs quoting in unix.  Should \r be quoted for windows
users or silently converted to \n (it has really no place in the vorbis
comment header)?  In any case, they should all be converted to \n in the
non-quoted form for normal screen output.


-- 
Beni Cherniavsky <cben at tx.technion.ac.il>

Awake! Awake! Fear, Fire, Foes! Awake! Fire, Foes! Awake! [Tolkien, LOTR]
Fight software patents:  http://lpf.ai.mit.edu/
BTW, does somebody know what's the situation in Israel
concerning software patents?

<p><p><p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.




More information about the Vorbis mailing list