|
Prev: some users cannot open asp page or see some images on the intranet
Next: ASP with XML isn't working :-(
From: "Jon Paal [MSMD]" Jon nospam Paal on 24 Mar 2008 13:16 The solutions provided work for others. The problem you have is not an ASP problem per se. I suspect you will need to look elsewhere in your database/server/browser to find the problem. I suggest you start debugging by allowing the page to be viewed by someone else with another browser so you can start eliminating variables. Narrow down the problem to where it can be isolated and then you may be able to resolve this matter.
From: S N on 24 Mar 2008 14:08 which group should i consult. please help "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere dot com> wrote in message news:13ufof3gdvavcd3(a)corp.supernews.com... > The solutions provided work for others. The problem you have is not an > ASP problem per se. > > I suspect you will need to look elsewhere in your database/server/browser > to find the problem. > > I suggest you start debugging by allowing the page to be viewed by someone > else with another browser so you can start eliminating variables. > > Narrow down the problem to where it can be isolated and then you may be > able to resolve this matter. >
From: "Jon Paal [MSMD]" Jon nospam Paal on 24 Mar 2008 14:25 I would start here: microsoft.public.scripting.vbscript
From: Anthony Jones on 24 Mar 2008 16:12 You need to make sure response.charset and response.codepage are consistent otherwise you will get mess. Its clear that you problem is with the data in the DB. -- Anthony Jones - MVP ASP/ASP.NET "S N" <uandme72(a)yahoo.com> wrote in message news:O3b5VocjIHA.748(a)TK2MSFTNGP04.phx.gbl... you have guessed it right, i am copying the text from ms word but am cleaning wordhtml using wordcleaner 3. further, i checked using Response.CharSet = "UTF-8" in this case the ? characters appears on every newline including the places where it was appearing earlier. when i use <%Response.CharSet = "Windows-1252"%> still the problem of question marks remain. but it appears only as was appearing earlier (in place of " and not on every new line) i checked the view source- the server is sending ? character itself to the browser. when i checked the database field, it is showing in invalid character in the shape of a rectangle stored where i want the double quote " printed. please help. "Anthony Jones" <Ant(a)yadayadayada.com> wrote in message news:ejiWc1tiIHA.5780(a)TK2MSFTNGP06.phx.gbl... My guess is that they are not " " but are ' " " typically cut'n'pasted in from Microsoft Word. These are still in the Windows-1252 range of characters but are not strictly in the iso-8859-1 set. Don't use http-equiv meta tags use real headers instead. IOW ditch the meta tags and include this:- <%Response.CharSet = "Windows-1252"%> I'm not hopeful because you are probably using IE and IE will treat ISO-8859-1 as Windows-1252 anyway. Always use Server.HtmlEncode on values retrieved from the Database. Stop mucking about with any other approach. If that doesn't work view the html source from the browser. What is the server actually sending. Another alternative is stop using Windows-1252. Save your pages as UTF-8 change the codepage at the top of the page to 65001 and include Response.CharSet = "UTF-8" in your page. BTW, Have you looked at the field content directly using the DB management tool? -- Anthony Jones - MVP ASP/ASP.NET "S N" <uandme72(a)yahoo.com> wrote in message news:OgWpL$piIHA.4344(a)TK2MSFTNGP03.phx.gbl... i am attaching the sample code. actually i am printing from a field in access database. the text entered in the database contains single quotes and double quotes. when i try to print them using response.write, the double quotes are getting replaced with question marks. i have tried the method of DataPrep = Replace(DataPrep, """", """) still problem remains. i also tried response.write(server.htmlencode(myrs(3))) ' where myrs is adodb recordset still the problem remains i am also attaching the header lines from my asp page <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <HTML><HEAD> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="Content-Language" content="en-us" /> the problem is still not solved please help "Anthony Jones" <Ant(a)yadayadayada.com> wrote in message news:%23jGo1GRiIHA.5088(a)TK2MSFTNGP02.phx.gbl... > "Bob Barrows [MVP]" <reb01501(a)NOyahoo.SPAMcom> wrote in message > news:%233n2yuBiIHA.4744(a)TK2MSFTNGP06.phx.gbl... >> Daniel Crichton wrote: >> > ' and " are HTML entities - these are converted by web >> > browsers into ' and " respectively. >> > >> > If you just want to print the literal characters, that's easy enough: >> > >> > Response.Write """" >> > >> > will print a single " (there are 4 " in that line, the two outer ones >> > are the string containers, the two inners generate the single " as >> > doubling them up inside a string turns them into a literal instead). >> > >> > another example >> > >> > Response.Write "<a href=""http://myurl.com/apage.asp"">This is a >> > link</a>" >> > Notice how you just double up the quotation marks. >> > >> > For an apostrophe you don't need to do anything special: >> > >> > Response.Write "They're not here" >> > >> > So what problem are you having with quotes and apostrophes? >> > >> >> From the original post: "my code using response.write replaces " character >> with question >> mark" >> >> It's most likely a codepage problem. I've been holding back from replying > to >> this because Anthony typically has the most reliable advice for these >> situations. >> > > Thanks for the vote of confidence Bob but it baffles me. ;) > > Since " is within the lower ascii range 0-127 the only encoding that could > screw this up would be UTF-16. But if the browser thought it was getting > say Windows-1252 and yet the server was encoding to UTF-16 (or vice versa) > the content would be completely garbled. > > I suspect that what the OP thinks is happening and what actually is are very > different. Like Dan says I think we would need to see some actual code to > make sense of this. > > -- > Anthony Jones - MVP ASP/ASP.NET > >
From: Anthony Jones on 24 Mar 2008 16:13
All I'm seeing is a standard apostrophe. If what you see in the DB is not the character you are expecting then your problem is probably now with the languages you have installed. I don't think all glyphs are installed for each font by default, you need to install the appropriate language for the system to be able to render them. How is did the data arrive in the DB? Via HTML Form and ASP? -- Anthony Jones - MVP ASP/ASP.NET "S N" <uandme72(a)yahoo.com> wrote in message news:%23m$1focjIHA.748(a)TK2MSFTNGP04.phx.gbl... i changed the codepage tp 65001 and charset to utf-8, then the question mark ? showing earlier, has changed to the rectangle as shown below. ' the database field also shows the same character stored in it. please help. "Anthony Jones" <Ant(a)yadayadayada.com> wrote in message news:ejiWc1tiIHA.5780(a)TK2MSFTNGP06.phx.gbl... My guess is that they are not " " but are ' " " typically cut'n'pasted in from Microsoft Word. These are still in the Windows-1252 range of characters but are not strictly in the iso-8859-1 set. Don't use http-equiv meta tags use real headers instead. IOW ditch the meta tags and include this:- <%Response.CharSet = "Windows-1252"%> I'm not hopeful because you are probably using IE and IE will treat ISO-8859-1 as Windows-1252 anyway. Always use Server.HtmlEncode on values retrieved from the Database. Stop mucking about with any other approach. If that doesn't work view the html source from the browser. What is the server actually sending. Another alternative is stop using Windows-1252. Save your pages as UTF-8 change the codepage at the top of the page to 65001 and include Response.CharSet = "UTF-8" in your page. BTW, Have you looked at the field content directly using the DB management tool? -- Anthony Jones - MVP ASP/ASP.NET "S N" <uandme72(a)yahoo.com> wrote in message news:OgWpL$piIHA.4344(a)TK2MSFTNGP03.phx.gbl... i am attaching the sample code. actually i am printing from a field in access database. the text entered in the database contains single quotes and double quotes. when i try to print them using response.write, the double quotes are getting replaced with question marks. i have tried the method of DataPrep = Replace(DataPrep, """", """) still problem remains. i also tried response.write(server.htmlencode(myrs(3))) ' where myrs is adodb recordset still the problem remains i am also attaching the header lines from my asp page <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <HTML><HEAD> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="Content-Language" content="en-us" /> the problem is still not solved please help "Anthony Jones" <Ant(a)yadayadayada.com> wrote in message news:%23jGo1GRiIHA.5088(a)TK2MSFTNGP02.phx.gbl... > "Bob Barrows [MVP]" <reb01501(a)NOyahoo.SPAMcom> wrote in message > news:%233n2yuBiIHA.4744(a)TK2MSFTNGP06.phx.gbl... >> Daniel Crichton wrote: >> > ' and " are HTML entities - these are converted by web >> > browsers into ' and " respectively. >> > >> > If you just want to print the literal characters, that's easy enough: >> > >> > Response.Write """" >> > >> > will print a single " (there are 4 " in that line, the two outer ones >> > are the string containers, the two inners generate the single " as >> > doubling them up inside a string turns them into a literal instead). >> > >> > another example >> > >> > Response.Write "<a href=""http://myurl.com/apage.asp"">This is a >> > link</a>" >> > Notice how you just double up the quotation marks. >> > >> > For an apostrophe you don't need to do anything special: >> > >> > Response.Write "They're not here" >> > >> > So what problem are you having with quotes and apostrophes? >> > >> >> From the original post: "my code using response.write replaces " character >> with question >> mark" >> >> It's most likely a codepage problem. I've been holding back from replying > to >> this because Anthony typically has the most reliable advice for these >> situations. >> > > Thanks for the vote of confidence Bob but it baffles me. ;) > > Since " is within the lower ascii range 0-127 the only encoding that could > screw this up would be UTF-16. But if the browser thought it was getting > say Windows-1252 and yet the server was encoding to UTF-16 (or vice versa) > the content would be completely garbled. > > I suspect that what the OP thinks is happening and what actually is are very > different. Like Dan says I think we would need to see some actual code to > make sense of this. > > -- > Anthony Jones - MVP ASP/ASP.NET > > |