Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRebecca Turner <turner@mikomi.org>2015-01-05 11:46:51 +0300
committerRebecca Turner <me@re-becca.org>2015-06-26 03:26:39 +0300
commit5b1d8c951a566b975b25be6c3b540ffc1ce6850a (patch)
tree0a1819691396586d1b531583ab4d83e5732bb9cb /node_modules/has-unicode/index.js
parent933a16f0d39a61b2c9400d084ca102206ec028a1 (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.js18
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
+}