浏览代码

added BOM check

ncannasse 6 年之前
父节点
当前提交
a0928e77c4
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      other/haxelib/Run.hx

+ 3 - 0
other/haxelib/Run.hx

@@ -29,6 +29,9 @@ class Build {
 	}
 	
 	function isAscii( bytes : haxe.io.Bytes ) {
+		// BOM CHECK
+		if( bytes.length > 3 && bytes.get(0) == 0xEF && bytes.get(1) == 0xBB && bytes.get(2) == 0xBF )
+			return true;
 		var i = 0;
 		var len = bytes.length;
 		while( i < len ) {