Solved

Classic ASP submit form to csv

Posted on 2011-03-18
2
580 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now