Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMIL or XHTML (such as NavDoc) with UTF8 BOM fail to XML-parse #123

Closed
danielweck opened this issue Nov 12, 2014 · 1 comment
Closed

SMIL or XHTML (such as NavDoc) with UTF8 BOM fail to XML-parse #123

danielweck opened this issue Nov 12, 2014 · 1 comment

Comments

@danielweck
Copy link
Member

To check if there is a BOM:

sed $'1 s/\xEF\xBB\xBF/BOM/' < "/PATH/TO/FILE" | head -c10 && echo ""
@danielweck
Copy link
Member Author

To list all the culprit files in the current folder:

find . -type f \( -name "*.html" -or -name "*.xhtml" -or -name "*.js" -or -name "*.css" -or -name "*.smil" \) -print0 | xargs -0 -I % sh -c "echo ''; echo %; sed $'1 s/\xEF\xBB\xBF.*/zzzzzzzzzzzzzz BOM/' < % | head -n1 ; echo ''"

Or to filter out only the BOMs:

find . -type f \( -name "*.html" -or -name "*.xhtml" -or -name "*.js" -or -name "*.css" -or -name "*.smil" \) -print0 | xargs -0 -I % sh -c "echo ''; sed $'1 s/\xEF\xBB\xBF.*/BOM /' < % | head -c4 ; echo %;" | grep "BOM"

@danielweck danielweck changed the title SMIL files with UTF8 BOM fail to load SMIL or XHTML (such as NavDoc) with UTF8 BOM fail to XML-parse Nov 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants