-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Double backslashes are turned into one #30
Comments
This is a serious problem for ini.parse conversion that have windows share information in them. For example starting with this information in an ini file:
then execute this code against the above text:
This is always interpreted and ruined (by the ini.parse) as:
which means that once I go to output the data back to an INI file, like this:
The resulting INI file now contains this:
Is this going to be looked at and put in the bug queue? |
AS a TEMPORARY work-around, you can do the following (this is typescript, but the same thing can be done in javascript, without the type definitions):
The key change is the escape line of code that uses the replace to escape the backslashes in the raw text before being interpreted by the ini.parse method.
|
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. |
I'm on windows (don't think it is revelant) and I have a problem with values containing multiple backslashes like
\\192.168.1.1
, the parser turn the\\
into\
Is it expected behavior? I don't think it should be since a simple read then reencode change the file and lose information.
Exemple:
first pass:
\\\\
read as\\
and then encoded as\\
second pass:
\\
read as\
and then encoded as\
third pass:
\
read as\
and then encoded as\
The text was updated successfully, but these errors were encountered: