vbscript - HTML VBS Special Character handling -


i have file uses website specific query , returns data needed via html headers. when writing returned data file sql query supplied works fine. if query has special characters in it, stops @ point.

examples of characters cause problem "?", "~", "_". have tried find several work arounds data coming have yet determine new means functions.

this how exporting data when comes back:

set objexportfile = objfso.opentextfile(exportfilelocation, 8, true, -1) objexportfile.writeline(objhead.responsetext) objexportfile.close 

thanks,

you this

dim badchar(2) dim char dim header badchar(0) = "?" badchar(1) = "~" badchar(2) = "_"  header = objhead.responsetext each char in badchar  if instr(header, char)   header = replace(header, char, "")  end if next set objexportfile = objfso.opentextfile(exportfilelocation, 8, true, -1) objexportfile.writeline(header) objexportfile.close 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -