How do straight quotes become curved quotes when copying from a web page to a text editor?

1

I copied some code from a web page and into my text editor.

The double quote characters changed to this:

<iframe src=“http://www.yahoo.com” style=“width:500px; height:500px;” frameborder=“0?></iframe>

instead of this (which is what I needed):

<iframe src="http://www.yahoo.com" style="width:500px; height:500px;" frameborder="0"></iframe>

Why?

Karl

Posted 2009-09-29T18:31:37.793

Reputation: 73

What editor are you using? – Joshua Nurczyk – 2009-09-29T20:12:12.117

I'm using Netbeans. – Karl – 2009-09-29T22:15:21.820

Answers

2

Some editors don't handle "smart quotes" well or forcibly convert them to "dumb quotes".

EDIT: I read your examples backwards - the opposite happened: you got so-called "smart" quotes from plain ones. In some editors, that's a configurable setting. And understand that word processors are very different from ordinary text editors. Using Word as a text editor can do strange and damaging things to code or markup languages.

DaveE

Posted 2009-09-29T18:31:37.793

Reputation: 186

1yup, change your editor :) +1 – None – 2009-09-29T18:49:02.860

2I think he's saying that it converted "dumb" quotes to "smart" quotes. Which would imply that he's using a word processor of some nature, and not a text editor. – wfaulk – 2009-09-29T19:08:31.417

@wfaulk - yah, you're right. – DaveE – 2009-09-29T19:11:52.627

No, I'm not using a word processor - I'm using Netbeans, which is a programming IDE. – Karl – 2009-09-29T22:16:27.780

I don't have NetBeans installed here, but a little googling found this: Tools -> Options -> Editing -> Editor Settings -> Java Editor -> Pair Character Completion. I'm not sure if the setting can be applied to the editor generally or is language-specific. – DaveE – 2009-10-01T20:07:35.200

1

You need a text editor that's HTML aware e.g. Notepad++. Either that or something 'dumber' than the editor you're using (like Notepad) which won't attempt to 'smart-quote' your code.

pelms

Posted 2009-09-29T18:31:37.793

Reputation: 8 283

Actually, any real text editor would do better than that, HTML-aware or not. – David Thornley – 2009-09-29T21:28:42.697

0

Most likely the software is trying to be helpful. If, when you type a quote, it becomes a “ character, wouldn't you want it to do the same conversion when pasting in text?

Albert

Posted 2009-09-29T18:31:37.793

Reputation: 155