Curly quotation marks vs Square quotation marks, w

2019-07-04 17:02发布

An interesting problem that no doubt someone here has come across before.

I'm reading a CSV file that contains some values wrapped in quotes, I came across a problem today were my app couldn't read the file as the value was wrapped in cury quotation marks and not square quotation marks. Is this an encoding problem? I simply replaced the quotes replacing curly quote with ".

Can someone explain why this happens and what I can do about it? I'm using C#

标签: c# encoding csv
2条回答
贼婆χ
2楼-- · 2019-07-04 17:13

I think that the curly quotation marks you're referring to are actually "smart quotes," which are usually inserted by Microsoft Office products. IIRC, they have a Unicode value, but if you're dealing with ASCII only or well-formed XML they wreak havoc.

查看更多
不美不萌又怎样
3楼-- · 2019-07-04 17:17

I suspect the data was copied and pasted from a document created using Word.

By default Word 2003 will convert "straight quotes" to what it calls “smart quotes”. You can override this behavior using Tools/AutoCorrect Options/AutoFormat as you type.

查看更多
登录 后发表回答