File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -416,6 +416,27 @@ module.exports = function( grunt ) {
416416 return path !== "*" ;
417417 } ) ;
418418
419+ // Ensure the dist files are pure ASCII
420+ var fs = require ( "fs" ) ,
421+ nonascii = false ;
422+ distpaths . forEach ( function ( filename ) {
423+ var buf = fs . readFileSync ( filename , "utf8" ) ,
424+ i , c ;
425+ if ( buf . length !== Buffer . byteLength ( buf , "utf8" ) ) {
426+ log . writeln ( filename + ": Non-ASCII characters detected:" ) ;
427+ for ( i = 0 ; i < buf . length ; i ++ ) {
428+ c = buf . charCodeAt ( i ) ;
429+ if ( c > 127 ) {
430+ log . writeln ( "- position " + i + ": " + c ) ;
431+ log . writeln ( "-- " + buf . substring ( i - 20 , i + 20 ) ) ;
432+ nonascii = true ;
433+ }
434+ }
435+ }
436+ } ) ;
437+ if ( nonascii ) {
438+ return false ;
439+ }
419440
420441 // Proceed only if there are actual
421442 // paths to write to
Original file line number Diff line number Diff line change @@ -605,7 +605,7 @@ jQuery.extend({
605605 } ,
606606
607607 // Use native String.trim function wherever possible
608- trim : core_trim && ! core_trim . call ( "\xFEFF \xA0" ) ?
608+ trim : core_trim && ! core_trim . call ( "\uFEFF \xA0" ) ?
609609 function ( text ) {
610610 return text == null ?
611611 "" :
You can’t perform that action at this time.
0 commit comments