Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

Failure parsing file with CRLF line endings #50

Open
smokku opened this issue May 18, 2021 · 0 comments
Open

Failure parsing file with CRLF line endings #50

smokku opened this issue May 18, 2021 · 0 comments

Comments

@smokku
Copy link

smokku commented May 18, 2021

I tried parsing a simple document with HoconLoader::new().load_str(string):

{
    aaa {
        bbb = "ccc"
    }
}

It failed with Error::Parse.

While trying to debug it, it turns out that the same config parses fine when loaded using r#{ ... }"# string.

I hexdumped both strings.

file:

0 |7b0d0a20 20202061 6161207b 0d0a2020| {..    aaa {..   00000000
1 |20202020 20206262 62203d20 22636363|       bbb = "ccc 00000010
2 |220d0a20 2020207d 0d0a7d0d 0a|       "..    }..}..    00000020

string:

0 |7b0a2020 20206161 61207b0a 20202020| {.    aaa {.     00000000
1 |20202020 62626220 3d202263 6363220a|     bbb = "ccc". 00000010
2 |20202020 7d0a7d0a|                       }.}.         00000020

The string failing parsing has CRLF (0d0a) line endings. The string parsing fine has LF (0a) line endings.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant