Last active
August 29, 2015 14:01
-
-
Save hiddenist/ebf633042ef32e049758 to your computer and use it in GitHub Desktop.
Function to detect and strip UTF-8 BOM from a string in ASP/VBScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
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