yajl and string encoding, for the archive
- Lloyd Hilaiel
- 2009-12-01 @ 21:18
[2:13pm]lth:a json string
[2:13pm]lth:may be stored in a UTF32 string, an ASCII string, a UTF8
string, or any ol string you want
[2:13pm]lth:yajl only deals in UTF8 strings. everyone else should go home.
[2:14pm]lth:because ascii is a subset of UTF8, it'll handle that just fine
[2:14pm]lth:but if you pass in an ascii string, you'll get out a utf8
[2:14pm]lth:cause yajl's all infectious about it's utf8 preference
[2:15pm]lth:sane & sensical?
[2:15pm]•brianmario thinks so
[2:15pm]lth:we *could* add an ensure ascii output flag to the generator
[2:15pm]rtyler:I'm actually indifferent to be honest, more of the "piss
off, I'll encode this how I want"
[2:15pm]lth:it'd be trivial to do
[2:16pm]lth:otoh, if you got a wierd ass single-byte encoding and you
don't want yajl to touch it
[2:17pm]lth:you can just pass that config flag tellin' me to *not* validate utf8
[2:17pm]lth:and we should get along just fine