RFC: std.json sucessor

via Digitalmars-d digitalmars-d at puremagic.com
Mon Aug 25 12:50:19 PDT 2014


On Monday, 25 August 2014 at 19:38:05 UTC, Walter Bright wrote:
> The adaptation is to take arbitrary byte input in an unknown 
> encoding and produce valid UTF.

I agree.

For a restful http service the encoding should be specified in 
the http header and the input rejected if it isn't UTF 
compatible. For that use scenario you only want validation, not 
conversion. However some validation is free, like if you only 
accept numbers you could just turn off parsing of strings in the 
template…

If files are read from storage then you can reread the file if it 
fails validation on the first pass.

I wonder, in which use scenario it is that both of these 
conditions fail?

1. unspecified character-set and cannot assume UTF for JSON
3. unable to re-parse


More information about the Digitalmars-d mailing list