Utf8Json icon indicating copy to clipboard operation
Utf8Json copied to clipboard

Culture problem?

Open sebas77 opened this issue 6 years ago • 0 comments

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...

sebas77 avatar Jun 06 '19 13:06 sebas77