ExcelProvider
ExcelProvider copied to clipboard
Culture Info setting
Is there any way (or plans) to allow setting Globalization settings when reading sheets? If you use ForceString = true
, it appears to return the data in the OS culture, rather than the current culture of the app domain that's been set. This causes problems downstream if you then do any parsing operations.
This one bit me today. My expectation from ForceString was that I would get the same exact string that I see in Excel. If I have the characters 12,34 in Excel I don't expect to get the string "12.34", its not the same sequence of characters. 😄
A very real problem is also that the behavior will change depending on the cell format. I am certain that this would have haunted me in the future if I hadn't noticed it today.
English USA OS with Swedish Regional Settings Excel format: General 12(comma)34 --> "12(dot)34" Excel format: Text 12(comma)34 --> "12(comma)34"
I guess it has something to do with using the string
operator to convert values to String. string
operator will attempt to use InvariantCulture
instead of the current culture if the input can be casted to IFormattable