Re: New invalid UTF-8 proposal using tags and %nn

Oren Ben-Kiki <[email protected]>
Newsgroups gmane.text.yaml.general
Message-ID <1252208343.5036.110.camel@nero>
On Sat, 2009-09-05 at 19:03 -0400, BlueGM wrote:
> Ah, so you're thinking the canonical form should just look at the byte
> values of the stream with nonescaped characters translated into utf-8
> encoded bytes, rather than try to leave valid Unicode characters
> underinflated. As I think about it, that makes a lot of sense.

Yes.

> Though if we
> do that, why bother with the % sign? We could either use the hex
> representation or even encode it as base64...
> Or is that to make the canonical form one of
> the presentation forms?

Yes, it is nice to have the canonical form be a valid presentation. Now
that I think of it, the spec doesn't actually demand it, but it makes
sense to do this.

As you pointed out, you are never forced to create the canonical form.
It is used to define equality (and hashes and so on), but all these
could be implemented efficiently "as if" they were using the canonical
form. There's no inefficiency involved.

> If so, then the expression would probably have to be
> like this:
>     (%[0-9a-f][0-9a-f])*

Yes, that's what I said.

> One possible problem with this canonical form, however, is if there are any
> writers that simply write the canonical form to the YAML file.

No... the canonical form is not defined to be the default (most
readable) form. Take !!binary for example; the canonical form does not
wrap long lines, but obviously most writers do wrap long lines by
default.

> > Right. Another item to the YAML spec-related work TODO list :-S
> 
> Would it help if one of us created an HTML document in the format and style
> you use for other data types? If so, I'd be willing, if William doesn't want
> to do it (I think he has dibs on me if he does =p).

Yes, it would help - though I think this format needs an upgrade. In
fact the whole repository does (to be made compatible with YAML 1.2).
"So much time, so little to do" - not :-)

Have fun,

    Oren Ben-Kiki



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.