This raises the larger point that our JSON support is really fragile,
though.


On Mon, Mar 17, 2014 at 9:24 AM, Huon Wilson <notifications@github.com>wrote:

> In src/libserialize/json.rs:
>
> >          if idx != 0 { try!(write!(self.wr, ",")) }
> > -        f(self)
> > +        // ref #12967, make sure to wrap a key in double quotes,
> > +        // in the event that its of a type that omits them (eg numbers)
> > +        let mut buf = MemWriter::new();
> > +        let mut check_encoder = Encoder::new(&mut buf);
> > +        f(&mut check_encoder);
> > +        let buf = buf.unwrap();
> > +        let out = from_utf8(buf).unwrap();
> > +        let needs_wrapping = out.char_at(0) != '"' &&
> > +            out.char_at(out.len() - 1) != '"';
>
> Oh, hm; I guess so. (It's worth having a comment about why we can just
> wilfully fly in the face of unicode.)
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/mozilla/rust/pull/12973/files#r10655371>
> .
>



-- 
http://octayn.net/