Forum Moderators: open

Message Too Old, No Replies

Problem exporting ASP generated HTML to MSWord

Getting á instead of non breaking space

         

MozMan

11:31 pm on Oct 22, 2004 (gmt 0)

10+ Year Member



OK- I'm having an odd problem with an ASP application I recently built. It's an internal assessment application, and here's what the problem area is designed to do:

1- You pick a person
2- You get a list of the tests that person took, and pick which one you want to see the report of
3- The report data is harvested from the database, and a nice pretty report is created
4- There is a button at the bottom that you can click to have the report exported to a Word document that you can save for all posterity.

Now, what I do is this: When the HTML for the report is generated in step 3 above, I put it all into a form variable to pass to the page that creates the Word doc. I did this so that when they ask me to make other reports exportable, I can use the same code to create the Word document and just pass it the report results for whatever report I want.

The code on the page that creates the Word doc looks like this:


Response.Buffer = True
Response.ContentType = "application/vnd.ms-word"
Response.AddHeader "content-disposition", "inline; filename = DevelopmentPlan.doc"
%>
<html><head></head><body>
<%
Response.Write Request.Form("strReport")
%>
</body></html>

And it works famously MOST of the time.

The problem is, that SOMETIMES anyplace I have an nbsp the word doc displays "á" instead. But it doesn't happen every time.

Any ideas why this might happen? I'd appreciate any thoughts at all!

Thanx!

-Moz

macrost

5:19 pm on Oct 25, 2004 (gmt 0)

10+ Year Member



Moz,
Just a quick idea, have you set the encoding of the page that does the word stuff?

MozMan

7:37 pm on Oct 25, 2004 (gmt 0)

10+ Year Member



Well, the code in the box in my original post is all that is on that page; so, no.

Any idea what the encoding type should be?

-Moz

mattglet

7:42 pm on Oct 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try putting:

<meta http-equiv="content-type" content="text/html; charset=UTF-8">

in your head tags. It'll be a starting point.

MozMan

7:49 pm on Oct 25, 2004 (gmt 0)

10+ Year Member



That did the trick!

Thanx mattglet! You're a peach. :^)

-Moz