Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Function to detect and strip UTF-8 BOM from a string in ASP/VBScript
<%
Function stripBOM(ByVal content)
stripBOM = content
If Len(content) > 2 Then
If AscW(Mid(content, 1, 1)) = &HEF AND _
AscW(Mid(content, 2, 1)) = &HBB AND _
AscW(Mid(content, 3, 1)) = &HBF _
Then
stripBOM = Mid(content, 4)
End If
End If
End Function
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.