By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,827 Members | 2,155 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,827 IT Pros & Developers. It's quick & easy.

"Smart Quotes" in comments?

P: n/a
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?
Jun 11 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
* 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.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jun 11 '06 #2

P: n/a

red floyd wrote:
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.

Jun 11 '06 #3

P: n/a

SuperKoko wrote:
red floyd wrote:
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.

Jun 11 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.