tags:

views:

682

answers:

2

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#

+4  A: 

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.

Joe
+3  A: 

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.

Kevin Gorski