Remove Byte-Order Mark (BOM) In Classic ASP, VBScript

 Web Stuff  Comments Off on Remove Byte-Order Mark (BOM) In Classic ASP, VBScript
May 192011
I wasn't able to find much on this with web searching (enough to be able to cobble together this solution, but that's it!)... so thought I'd post it in case it helps others.  I needed to remove the "byte order mark" (BOM) from the beginning of a file that had been read into a variable in a classic asp page (VBscript).  The BOM was output to the web page otherwise.  The contents of the file have been read into the variable "fileContent" in this case, then use this VBscript to check for and remove it:
'remove BOM if present
If (Len(Trim(fileContent)) > 0) Then
  Dim AscValue : AscValue = Asc(Trim(fileContent))
  If ((AscValue = -15441) Or (AscValue = 239)) Then : fileContent = Mid(Trim(fileContent),4) : End If
End If
Aug 272005
XmlException: The data at the root level is invalid. Line 1, position 1.

This might be a really obscure (or dumb?) ASP.NET / C# problem, but again I thought I'd post something about it in case it helps someone else searching about this issue....

I was getting an exception when loading an XML file:

  Error with ... xml\nav.xml: System.Xml.XmlException:
The data at the root level is invalid. Line 1, position 1.
at System.Xml.XmlTextReader.ParseRoot()
at System.Xml.XmlTextReader.Read()
at System.Xml.XmlValidatingReader.ReadWithCollectTextToken()
at System.Xml.XmlValidatingReader.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.LoadXml(String xml)

Continue reading »

Show Select Option Values

 Web Stuff  Comments Off on Show Select Option Values
Feb 172005

This is a bookmarklet I wrote up for my own use since I wasn't able to find something that performs a similar function (probably there IS something out there, I just wasn't able to find it in a short amount of time 🙂... It's really for the purposes of web development (well that's why I made it at least) when you either need to show or print out all the options that are available in a web page form drop-down (select) list. I'm sharing it here in case it can help someone else but I cannot, of course, provide any support (help getting it to work) or guarantees about it at all - use at your own "risk", figure it out on your own time, etc. etc.

Continue reading »

MT Blacklist + Comment Queue Hack + MT Notifier

 Web Stuff  Comments Off on MT Blacklist + Comment Queue Hack + MT Notifier
Mar 312004

Thanks to what is now commonly known as blog "comment spam", I had shut my blog comments off last November for several months until I could take the time to figure out how I wanted to "deal" with it… at least until MovableType 3 comes out.

After recently doing some searching, and since my amount of comment traffic is not extremely high, I decided I’d love to have both Jay Allen’s wonderful MT Blacklist plugin as well as the Scriptygoddess "Coment Queue" idea (however I had to use David Raynes’ perl version because I am not running MySQL). I soon realized though that, by default, these two plugins/hacks might not necessarily "play together" too well…. but I was determined! This is an explanation of the basic steps and MT "hacks" I peformed to get MT Blacklist and the Comment Queue hack (and then later the MT Notifier plugin – see further down in the entry) (apparently) working on my blogs. Some of the comment spam still occasionally slips by MT Blacklist, but thanks to the comment queue, it will never see the light of day on this site. Continue reading »