Last active
March 13, 2024 08:45
-
-
Save antic183/619f42b559b78028d1fe9e7ae8a1352d to your computer and use it in GitHub Desktop.
remove utf-8 bom with javascript
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
// remove utf-8 BOM from ressource "res" | |
// res.charCodeAt(0) === 0xFEFF | res.charCodeAt(0) === 65279 | |
if (res.charCodeAt(0) === 0xFEFF) { | |
res = res.substr(1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@ianthedev
I could have phrased the comment to "cescoallegrini" and "eladkarako" more nicely, I agree with you. But it is simply a fact that many developers always think they know something better and this is often unjustified. Whoever gives it out must also be able to take it. And there are also many developers who sell themselves beyond their worth. Unfortunately, I have experienced this too often. In my opinion, the worst thing about it is that false information is shared and beginners learn the wrong thing.