Re: New invalid UTF-8 proposal using tags and %nn
Oren Ben-Kiki <[email protected]>
| Newsgroups | gmane.text.yaml.general |
|---|---|
| Message-ID | <1252098210.5036.4.camel@nero> |
On Fri, 2009-09-04 at 16:48 -0400, Brad R wrote:
> It is also entirely possible for a library to expose options to the
> application about how to handle the new data type. Options that a
> library might expose include:
>
> 1) Always return it as a byte array (I think this should be the
> default and required behavior)
This is the key point. Anything else is optional and completely up to
the library. For example:
> 2) Throw exceptions/Raise errors if it can't convert it to a valid
> string (so if an application only wants to deal with strings, it can)
Sure, this is a possible API. IMO this defeats the whole purpose of this
tag. It is a safe working assumption that if this tag is used, the
string will not be valid (Unicode). But sure, a library could provide
it.
> Is this something that the YAML spec needs to cover, though?
Most emphatically *no*. The YAML spec defines the data model. As long as
the data is preserved, the implementation is compliant. In fact the
whole !!utf-u tag is out of scope for the spec itself, just like !!
binary and a zillion others.
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