Solved

Classic ASP submit form to csv

Posted on 2011-03-18
2
601 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

728 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