Hyperion icon indicating copy to clipboard operation
Hyperion copied to clipboard

Culture sensitive field ordering in writers/readers

Open marius-klimantavicius opened this issue 3 years ago • 0 comments

ReflectionEx orders fields using current culture (it simply uses OrderBy(s=>s.Name)). It is possible (as I've encountered) that two different locales would result in different fields orders. In my case lt-LT orders y before o, so fields ToDate and Type are ordered ["Type", "ToDate"]. In en-US, o comes before y, so the fields are ordered as ["ToDate", "Type"]. Not sure how to fix that in non-breaking manner. Locally, I just added StringComparer.Ordinal.

Alternatively it could use manifest (if fields are listed) to generate correct reader.

marius-klimantavicius avatar Oct 07 '20 10:10 marius-klimantavicius