diff options
author | Rebecca Turner <turner@mikomi.org> | 2015-01-05 11:46:51 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2015-06-26 03:26:39 +0300 |
commit | 5b1d8c951a566b975b25be6c3b540ffc1ce6850a (patch) | |
tree | 0a1819691396586d1b531583ab4d83e5732bb9cb /node_modules/has-unicode/index.js | |
parent | 933a16f0d39a61b2c9400d084ca102206ec028a1 (diff) |
has-unicode@1.0.0
Add to give better unicode defaults by interrogating the locale
Diffstat (limited to 'node_modules/has-unicode/index.js')
-rw-r--r-- | node_modules/has-unicode/index.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/node_modules/has-unicode/index.js b/node_modules/has-unicode/index.js new file mode 100644 index 000000000..edceb7030 --- /dev/null +++ b/node_modules/has-unicode/index.js @@ -0,0 +1,18 @@ +"use strict" +var os = require("os") +var child_process = require("child_process") + +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 +} |