Utf8Json
Utf8Json copied to clipboard
Culture problem?
this line
static readonly byte[] nan_symbol_ = StringEncoding.UTF8.GetBytes(double.NaN.ToString());
returns a byte array of size 0 when Czech culture is used. It probably fails with other culture as well.
This would fix it:
static readonly byte[] nan_symbol_ = StringEncoding.UTF8.GetBytes(NumberFormatInfo.InvariantInfo.NaNSymbol);
no clue if it's a good fix. I don't even understand why this byte array is used in the way is used so...