Solved

Classic ASP submit form to csv

Posted on 2011-03-18
2
593 Views
Last Modified: 2012-05-11
I have this script that writes a form submission to a csv.  The problem is that it does not render apostrophes or quotation marks properly.  it produces • and â— along with a box with a question mark in it.


whichFN=server.mappath("/survey/results/" & FILENAME & ".csv")

	Set fstemp = server.CreateObject("Scripting.FileSystemObject")
	if (fstemp.FileExists(whichFN)) = true then
		Set filetemp = fstemp.OpenTextFile(whichFN, 8, true, 0)
	else
		Set filetemp = fstemp.CreateTextFile(whichFN, true, false)
		filetemp.writeline SORT
	end if
	filetemp.writeline message2
	filetemp.close

Open in new window

0
Comment
Question by:rswanigan
2 Comments
 
LVL 11

Accepted Solution

by:
tobzzz earned 500 total points
ID: 35171541
Hi rswanigan,

Is the actual page saved as UTF-8? You can open a page in Windows Notepad and save it as UTF-8 to be sure. You should have these tags in your page
(1) at the top of any ASP page:
<%@ Language=VBscript Codepage="65001" %>
and
(2) in between <head> tags
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
then
(3) save as U8-DOS/UTF-8

Good Luck!

/ Tobzzz
0
 

Author Comment

by:rswanigan
ID: 35173721
Tobzzz,

That looks like it may have worked.   I am going to do some more testing.  Also I check the old csv that was presenting problems and noticed it was encoded UTF-8.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question