Solved

Classic ASP submit form to csv

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

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

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

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

617 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