"Smart Quotes" in comments?

R

red floyd

I've got some code where somebody cut&pasted some comments from MS Word,
and so these comments have "smart quotes" (in particular apostrophes)
embedded.

The apostrophe is character hex 0x92.

2.1 indicates that characters not in the source character set are
converted to the universal character name that designates the character.

So far, so good. The non-source character gets translated. No big deal.

But then we have 2.2/2. "If the value for a universal character name is
less than 0x20 or in the range 0x7f-0x9f (inclusive), or if the
universal character name designates a character in the basic source
character set, then the program is ill-formed."

So would this character of 0x92 in a comment cause the entire program to
be ill-formed? Or is it OK because it's in a comment?
 
A

Alf P. Steinbach

* red floyd:
I've got some code where somebody cut&pasted some comments from MS Word,
and so these comments have "smart quotes" (in particular apostrophes)
embedded.

The apostrophe is character hex 0x92.

2.1 indicates that characters not in the source character set are
converted to the universal character name that designates the character.

So far, so good. The non-source character gets translated. No big deal.

But then we have 2.2/2. "If the value for a universal character name is
less than 0x20 or in the range 0x7f-0x9f (inclusive), or if the
universal character name designates a character in the basic source
character set, then the program is ill-formed."

So would this character of 0x92 in a comment cause the entire program to
be ill-formed? Or is it OK because it's in a comment?

Check out whether that 0x92 is really Unicode or just some local
character set; the universal character name is Unicode.
 
S

SuperKoko

red said:
I've got some code where somebody cut&pasted some comments from MS Word,
and so these comments have "smart quotes" (in particular apostrophes)
embedded.

The apostrophe is character hex 0x92.
AFAIK, apostrophe is an ASCII character (and thus, in range [0x0, 0x7F]
).
It is the character 39 (decimal) which is also character 0x27

Actually, it is a character of the basic source character set... It is
used for character literals.
 
S

SuperKoko

SuperKoko said:
red said:
I've got some code where somebody cut&pasted some comments from MS Word,
and so these comments have "smart quotes" (in particular apostrophes)
embedded.

The apostrophe is character hex 0x92.
AFAIK, apostrophe is an ASCII character (and thus, in range [0x0, 0x7F]
).
It is the character 39 (decimal) which is also character 0x27

Actually, it is a character of the basic source character set... It is
used for character literals.

Excuse me, I was confusing apostrophe and single quote.
In that case, the program should be ill-formed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top