"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/has-unicode/index.js" (7 Feb 2017, 657 Bytes) of archive /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Javascript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 "use strict"
    2 var os = require("os")
    3 
    4 var hasUnicode = module.exports = function () {
    5   // Recent Win32 platforms (>XP) CAN support unicode in the console but
    6   // don't have to, and in non-english locales often use traditional local
    7   // code pages. There's no way, short of windows system calls or execing
    8   // the chcp command line program to figure this out. As such, we default
    9   // this to false and encourage your users to override it via config if
   10   // appropriate.
   11   if (os.type() == "Windows_NT") { return false }
   12 
   13   var isUTF8 = /UTF-?8$/i
   14   var ctype = process.env.LC_ALL || process.env.LC_CTYPE || process.env.LANG
   15   return isUTF8.test(ctype)
   16 }