Detecting regional settings (List Separator) from web

Posted by Toms Mikoss on Stack Overflow See other posts from Stack Overflow or by Toms Mikoss
Published on 2009-06-18T09:07:29Z Indexed on 2011/01/11 19:54 UTC
Read the original article Hit count: 238

Filed under:
|
|

After having the unpleasant surprise that Comma Seperated Value (CSV) files are not necessarily comma-separated, I'm trying to find out if there is any way to detect what the regional settings list separator value is on the client machine from http request.

Scenario is as follows: A user can download some data in CSV format from web site (RoR, if it matters). That CSV file is generated on the fly, sent to the user, and most of the time double-clicked and opened in MS Excel on Windows machine at the destination. Now, if the user has ',' set as the list separator, the data is properly arranged in columns, but if any other separator (';' is widely used here) is set, it all just gets thrown into a single column. So, is there any way to detect what separator is used on the client machine, and generate the file accordingly?

I have a sinking feeling that it is not, but I'd like to be sure before I pass the 'can't be done, sorry' line to the customer :)

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby