Curly quotation marks vs Square quotation marks, what gives?

天涯浪子 提交于 2020-01-04 03:53:26

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!