473,484 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

"Smart Quotes" in comments?

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
3 3196
* 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

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

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
12203
by: Martin Goldman | last post by:
Hello all, I've been struggling for a few days with the question of how to convert "smart" (curly) quotes into straight quotes. I tried playing with the htmlentities() function, but all that is...
14
2649
by: David B. Held | last post by:
I wanted to post this proposal on c.l.c++.m, but my news server apparently does not support that group any more. I propose a new class of exception safety known as the "smart guarantee". ...
5
1632
by: Michael Olea | last post by:
Here is a design problem I ran into this am - and I have cleaned the bathroom, scrubbed toilet sink and tub, windexed all glass, mopped the floor, and vacuumed the house - no dice, the problem is...
11
6999
by: Ron | last post by:
Hello, I'm having an aggravating time getting the "html" spewed by Word 2003 to display correctly in a webpage. The situation here is that the people creating the documents only know Word, and...
7
20860
by: gar | last post by:
Hi, I need to replace all the double quotes (") in a textbox with single quotes ('). I used this code text= Replace(text, """", "'" This works fine (for normal double quotes).The problem...
2
2355
by: BobAchgill | last post by:
Is there a way to let the User click on a button on a web site and have that download and install my prepackaged compressed data directory and place it nicely under my existing VB .Net Form...
6
1468
by: forest demon | last post by:
what i want is a snippet of an XML comment, that when inserted above a method, will pickup stuff like the return value, etc. by default, a /// will supply method parameters, but not much else. ...
5
2873
by: Noozer | last post by:
I'm looking for a "smart folder" program to run on my Windows XP machine. I'm not having any luck finding it and think the logic behind the program is pretty simple, but I'm not sure how I'd...
0
7080
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6950
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7103
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6811
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7209
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4841
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4527
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3044
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
588
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.