default-encoding.js 386 B

123456789101112
  1. var defaultEncoding
  2. /* istanbul ignore next */
  3. if (global.process && global.process.browser) {
  4. defaultEncoding = 'utf-8'
  5. } else if (global.process && global.process.version) {
  6. var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10)
  7. defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary'
  8. } else {
  9. defaultEncoding = 'utf-8'
  10. }
  11. module.exports = defaultEncoding