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 ) {
416
416
return path !== "*" ;
417
417
} ) ;
418
418
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
+ }
419
440
420
441
// Proceed only if there are actual
421
442
// paths to write to
Original file line number Diff line number Diff line change @@ -605,7 +605,7 @@ jQuery.extend({
605
605
} ,
606
606
607
607
// 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" ) ?
609
609
function ( text ) {
610
610
return text == null ?
611
611
"" :
You can’t perform that action at this time.
0 commit comments