has-unicode
Advanced tools
Comparing version 1.0.1 to 2.0.0
10
index.js
@@ -5,5 +5,9 @@ "use strict" | ||
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 } | ||
// Recent Win32 platforms (>XP) CAN support unicode in the console but | ||
// don't have to, and in non-english locales often use traditional local | ||
// code pages. There's no way, short of windows system calls or execing | ||
// the chcp command line program to figure this out. As such, we default | ||
// this to false and encourage your users to override it via config if | ||
// appropriate. | ||
if (os.type() == "Windows_NT") { return false } | ||
@@ -10,0 +14,0 @@ var isUTF8 = /[.]UTF-8/ |
{ | ||
"name": "has-unicode", | ||
"version": "1.0.1", | ||
"version": "2.0.0", | ||
"description": "Try to guess if your terminal supports unicode", | ||
@@ -24,5 +24,5 @@ "main": "index.js", | ||
"devDependencies": { | ||
"require-inject": "^1.1.1", | ||
"tap": "^0.4.13" | ||
"require-inject": "^1.3.0", | ||
"tap": "^2.3.1" | ||
} | ||
} |
@@ -29,6 +29,9 @@ has-unicode | ||
Since at least Windows 7, `cmd` and `powershell` have been unicode capable. | ||
As such, we report any Windows installation as unicode capable. | ||
Since at least Windows 7, `cmd` and `powershell` have been unicode capable, | ||
but unfortunately even then it's not guaranteed. In many localizations it | ||
still uses legacy code pages and there's no facility short of running | ||
programs or linking C++ that will let us detect this. As such, we | ||
report any Windows installation as NOT unicode capable, and recommend | ||
that you encourage your users to override this via config. | ||
### Unix Like Operating Systems | ||
@@ -35,0 +38,0 @@ |
@@ -10,3 +10,3 @@ "use strict" | ||
}) | ||
t.is(hasUnicode(), true, "Windows is assumed to be unicode aware") | ||
t.is(hasUnicode(), false, "Windows is assumed NOT to be unicode aware") | ||
}) | ||
@@ -13,0 +13,0 @@ test("Unix Env", function (t) { |
4951
43
44
6