问题
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#
回答1:
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.
回答2:
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.
来源:https://stackoverflow.com/questions/334119/curly-quotation-marks-vs-square-quotation-marks-what-gives