node/deps/npm/node_modules/has-unicode/index.js
Rebecca Turner 507fc53e37 deps: upgrade npm to 3.3.10
PR-URL: https://github.com/nodejs/node/pull/3599
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-02 14:25:04 -05:00

18 lines
425 B
JavaScript

"use strict"
var os = require("os")
var hasUnicode = module.exports = function () {
// Supported Win32 platforms (>XP) support unicode in the console, though
// font support isn't fantastic.
if (os.type() == "Windows_NT") { return true }
var isUTF8 = /[.]UTF-8/
if (isUTF8.test(process.env.LC_ALL)
|| process.env.LC_CTYPE == 'UTF-8'
|| isUTF8.test(process.env.LANG)) {
return true
}
return false
}