1

I'm working with classic asp for over a decade and I don't remember to have seen this problem. Here is my code:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<% Option Explicit %>
<%


    Response.Expires = -1
    Response.CacheControl = "No-cache"
    Response.Charset = "windows-1252"
    Response.Buffer = false
    Server.ScriptTimeout = 300

%>
hello
world
with
unwanded
characters

And here is what i get in the output:

2a hello world with unwanded characters 0

Some characters are added at the begin and the end, i don't know why but it seems related to the Buffer. If I set Buffer = True it fix the problem, but because the real page will return a lot of data I have to set the buffer to false.

I checked the page encoding, all seems good, the file is saved in a windows-1252 encoding. The IIS configurations are the same as other pages on the site which don't have any problem.

I don't understand where these characters come from but i suppose it must be related to encoding, does someone have any idea ??

Thanks

7
  • 1
    How much are you sending that you want to turn off buffering, and do you see the same problem if you add a periodic Response.Flush instead of turning off buffering wholesale? Commented Oct 21, 2013 at 16:37
  • Try different browser. Try analyzing the raw server response to see what's actually being sent. Commented Oct 22, 2013 at 11:49
  • I finally kept the buffer enabled and sent the data in smaller chunks to the browser doing Response.Flush between each chunk, it worked fine. I'm still curious why it was doing that with the buffer disabled but since I have a working solution and not much time i'll move on i guess... Commented Oct 22, 2013 at 12:06
  • Same thing here...Looks like the extra characters appear in line with the placement of open/close asp tags. Characters are always hexadecimal. Also, the surrounding white-space will change the characters. Was unable to find a reason for the issue. Commented Apr 3, 2015 at 14:45
  • My website has the same problem. Oddly enough, I can't reproduce the problem; only certain clients can. They've tried Chrome and other browsers. In my case, the strange characters are inserted nearly everywhere...in the title tag even. Commented Feb 23, 2017 at 18:04

1 Answer 1

1

I had the same issue start occurring when I added the following URLRewrite rule to my web.config file. This blanks out the Server HTTP Header.

<rule name="Remove Server header">
    <match serverVariable="RESPONSE_Server" pattern=".+" />
    <action type="Rewrite" value="" />
</rule>

Removing the rule got rid of the issue. I have no idea WHY this is, but definitely fixed the issue for me.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.