File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change 22 var ret ;
33#if SUPPORT_BASE64_EMBEDDING
44 ret = tryParseAsDataURI ( filename ) ;
5- if ( ! ret ) {
6- #endif
7- if ( ! nodeFS ) nodeFS = require ( 'fs' ) ;
8- if ( ! nodePath ) nodePath = require ( 'path' ) ;
9- filename = nodePath [ 'normalize' ] ( filename ) ;
10- ret = nodeFS [ 'readFileSync' ] ( filename ) ;
11- #if SUPPORT_BASE64_EMBEDDING
5+ if ( ret ) {
6+ return binary ? ret : ret . toString ( ) ;
127 }
138#endif
14- return binary ? ret : ret . toString ( ) ;
9+ if ( ! nodeFS ) nodeFS = require ( 'fs' ) ;
10+ if ( ! nodePath ) nodePath = require ( 'path' ) ;
11+ filename = nodePath [ 'normalize' ] ( filename ) ;
12+ return nodeFS [ 'readFileSync' ] ( filename , binary ? null : 'utf8' ) ;
1513 } ;
1614
1715 readBinary = function readBinary ( filename ) {
Original file line number Diff line number Diff line change @@ -290,7 +290,7 @@ if (typeof process === 'object' && typeof process.versions === 'object' && typeo
290290 var nodeFS = require ( 'fs' ) ;
291291
292292 var nodeRead = function ( filename ) {
293- return nodeFS . readFileSync ( filename ) . toString ( ) ;
293+ return nodeFS . readFileSync ( filename , 'utf8' ) ;
294294 } ;
295295
296296 function globalEval ( x ) {
You can’t perform that action at this time.
0 commit comments