Does anyone know? Please Read [Third Attempt]

D

DaBrain

If you got the answer, thank you so much.


OK I have to ask this question again as I know it can’t be that
difficult, nor is it that rare. So a lot of people are doing something
wrong, but what are we doing wrong?


Someone types text in Ms Word, say a blog entry or forum post, then
they cut that text out of word and past it into a form on the web and
submit it. It get written to SQL Server.


The problem, word takes a single quote character #39 and turns it into
#146 in most cases, by default.



You then use a method let’s say GetDataSet() and work with that
data. The text is messed up: "It’s" becomes "it’s" This is
NOT a problem when using a DataReader, but when you return a DataSet...
XML you get this behavior.


Example


I have searched the web for the afore mention characters and found that
"many" web sites are displaying text in this manner For example here is
one that does so:


http://www.artima.com/forums/flat.jsp?forum=152&thread=159914

The first paragraph starts off this way:

“Using ASP.NET 2.0’s new GridView control with the new
ObjectDataSource â€

same messed up text in firefox


Using ASP.NET 2.0’s new GridView control with the new
ObjectDataSource allows
 
K

Kevin Spencer

What exactly are you asking? When you paste into a textarea, you are pasting
into a browser form element that accepts only pure text. How the formatted
text is "translated" into pure text is a function of the user's operating
system and/or the browser, of which there are many of both operating
systems, browsers, and system configurations on the Internet.

Therefore, there is no way to know from one form post to another what has
been sent from the user's computer to the server. The form data that arrives
on the server is pure text. The server cannot know whether what arrives is
what was intended by the user. It only knows what text it has received. It
faithfully handles the text data exactly as it was sent by the user. That is
all it can do.

In other words, GIGO - Garbage in, Garbage out. While is is possible to
create software that is intelligent enough to figure out all of these
things, it certainly hasn't been done yet, and is cost-prohibitve. What
you're describing is some fairly advanced artificial intelligence. Even if
Microsoft or some other software company were to come up with such software,
the cost of creating it would make it too expensive for most people to buy.

At some point, regardless, it is the user's responsibility to use their
software correctly. The idea that computers can be so smart as to figure out
the intentions of the user regardless of the input, and to correct any
possible mistakes made by the user is a pipe dream. If the day comes when
computers are as good at fuzzy logic as humans are, they will most likely
become as unreliable as humans are. No matter how smart computers become,
people are highly likely to keep out-dumbing them.

--
HTH,

Kevin Spencer
Microsoft MVP
Virtual Carpenter
http://unclechutney.blogspot.com

Paranoia is a state of mind.


If you got the answer, thank you so much.


OK I have to ask this question again as I know it can't be that
difficult, nor is it that rare. So a lot of people are doing something
wrong, but what are we doing wrong?


Someone types text in Ms Word, say a blog entry or forum post, then
they cut that text out of word and past it into a form on the web and
submit it. It get written to SQL Server.


The problem, word takes a single quote character #39 and turns it into
#146 in most cases, by default.



You then use a method let's say GetDataSet() and work with that
data. The text is messed up: "It's" becomes "itâ?Ts" This is
NOT a problem when using a DataReader, but when you return a DataSet...
XML you get this behavior.


Example


I have searched the web for the afore mention characters and found that
"many" web sites are displaying text in this manner For example here is
one that does so:


http://www.artima.com/forums/flat.jsp?forum=152&thread=159914

The first paragraph starts off this way:

"Using ASP.NET 2.0’s new GridView control with the new
ObjectDataSource "

same messed up text in firefox


Using ASP.NET 2.0’s new GridView control with the new
ObjectDataSource allows
 

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

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top