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
UTF-8 Byte Order Mark (  ) #47
Comments
I think the BOM was (is) in your own source file. You can also fix this by converting your source file to UTF-8 without BOM. Not sure if TextMate has that option (i am not using that). I don't think this is a bug in AssetCompress. |
AssetCompress doesn't add BOM to any files. It just processes what is there. And if various compressors all end up with the marks being there, perhaps they are in the file? |
The BOM is not visible in my source file, and does not show up in any of my uncompressed files when viewing in the browser, but as you both mentioned the file encoding is likely set to UTF-8 with BOM. I had tried converting to UTF-8 without BOM in TextMate, but couldn't find the option. I figured at a minimum, if somebody else has this issue they will at least be able to find this discussion; if you think it's appropriate, I could add a note about the BOM in the Wiki for future unsuspecting users. Thanks for the quick feedback! P.S. after some further research, it seems as though Visual Studio likes to create UTF-8 with BOM. I had grabbed my reset CSS file from a recent .NET project, so that's likely how the encoding got set in the first place. |
This character sequence was showing up in one of my asset-compressed CSS files:
I thought this was a regex parsing issue, so I tried turning off comment removal, manually removing the comments from my source file, and finally tried including a single css file with a single rule and no comments. I tried CssMin. I tried YUI compressor. The characters were still showing up and causing rendering issues on the front-end. I wound up googling for this character sequence, and learned that it is actually the UTF-8 Byte Order Mark, and it can show up when parsers treat file contents as a string. I don't know if there is an easy programmatic fix for this issue, but for anyone else having this issue, I was able to work around it by creating a new file in TextMate and pasting in the contents of my initial file. I'm guessing it was a character-encoding issue, but am not totally sure.
The text was updated successfully, but these errors were encountered: