npm / ini

An ini parser/serializer in JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] \\ becomes \.

ddff12 opened this issue · comments

commented

config.ini

path= \\server\test\001
let config = ini.parse(fs.readFileSync('./config.ini', 'utf-8'))

 // config.path → "\server\test\001"
 //  There is only one ’\’ at the beginning of the character.
// But there are two correctly. 

It is not bug of this package, it is feature of JavaScript.
Try it: console.log("\\");
It'll output \
Details is here: https://www.w3schools.com/js/js_strings.asp, see "backslash escape character"

Issue should be closed or edited

You can try my fork, ini-win, which aims to be more compatible with the way Windows handles ini files. Windows doesn't do any unescaping when reading the values, and so does my fork, so it fixes this issue.

commented

Duplicate of #30