JavaScript Console dislikes "smart quotes" pasted from MS Word ("Invalid character error")

RESOLVED WONTFIX

Status

Toolkit Graveyard
Error Console
RESOLVED WONTFIX
12 years ago
a year ago

People

(Reporter: Raphael Segun Awoseyin, Unassigned)

Tracking

Details

(Reporter)

Description

12 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060206 Firefox/1.6a1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060206 Firefox/1.6a1

When I cut and paste code from MS Word (2002) to the JavaScript console (particularly code with quotation marks) I get an 'invalid character error'. However, if I delete and re-enter the quotation marks, the code executes with no problem.

Reproducible: Always

Steps to Reproduce:
1. Open up MS Word and type javascript:alert(“Hello World!”)
2. Copy and paste that into the JavaScript Console
3. Hit 'evaluate'
4. Delete and then manually re-enter the quotation marks 
5. Hit 'evaluate'

Actual Results:  
The first time you hit evaluate you get an ‘invalid character’ error pointing to the quotation marks. The second time, the code executes.

Expected Results:  
The code should have executed without error both times.

Also tried varying the font face with both Times New Roman, and Arial but I got the same result. 
This is likely to ‘cause problems for programmers who use rich-text formats for their code. Cut and paste shouldn’t possess a problem for them.

Updated

12 years ago
Summary: Invalid character error when you cut and paste from MS Word 2002 release → JavaScript Console dislikes "smart quotes" pasted from MS Word ("Invalid character error")

Comment 1

12 years ago
I vote for wontfix.  Smart quotes are not quotes in JavaScript (just like in most programming languages), and I think it would only be confusing if the JavaScript console were more forgiving than a <script> tag.

Comment 2

12 years ago
Not only is it not a quote, but it's an "illegal character".  You can use a Japanese letter as a variable name, but not a smart quote.  I wonder if that's an intentional distinction.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → WONTFIX
(Assignee)

Updated

9 years ago
Product: Firefox → Toolkit
(Assignee)

Updated

a year ago
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.