开发者

What is the correct MIME type for a CSV File created by Excel with semicolon as separator

开发者 https://www.devze.com 2023-03-23 12:47 出处:网络
I work in Switzerland, where the semicolon ; is the \"official\" list separator in Windows\' regional settings.

I work in Switzerland, where the semicolon ; is the "official" list separator in Windows' regional settings.

Excel uses this separator when creating CSV files.

In RFC 4180 the CSV file is defined as comma separated and has the mime type of text/csv associated. My file does not conform to this definition.

I'm using application/vnd.ms-excel instead, but I'm not satisfied by declaring it an "Excel" file, since it's an application independent semicolon-separated file.

What would the correct MIME type be?开发者_运维百科

Thanks!


AFAIK there is no official mime-type for a semicolon-separated file. This is not surprising - the mime type also does not specify the character-encoding, for example.

You could simply use text/plain (since the file is after all simply a text file), but I presume that you want to use a particular mime type because you want the browser/OS to open it in an "appropriate" application. (This format is only really suitable for processing by an application of some sort).

I would think that in 90% of cases that appropriate application will be Excel. For the few users who don't have Excel but do have an Excel-a-like, you may find that the Excel-a-like application registers itself as able to consume Excel files, and so it may all just work as you wanted?

0

精彩评论

暂无评论...
验证码 换一张
取 消