toml11/toml
Martin Tournoij d2937ff4e1
Escape control characters in keys
Previously a key like:

        "a\u0000\u0001b" = 1

Would get written with literal control characters, rather than escapes:

        "a<00><01>b" = 1

The "valid/key/quoted-unicode" test from toml-test would fail with this,
although it seems they're not run automatically(?)

Can also reproduce with something like:

        % cat test.cpp
        #include <toml.hpp>
        #include <iostream>

        int main()
        {
                const auto data  = toml::parse("test.toml");
                std::cout << data << "\n";
                return 0;
        }

        % cat test.toml
        "a\u0000\u0001b" = "a\u0000\u0001b"

        % c++ -I. test.cpp

        % ./a.out
        "ab" = "a\u0000\u0001b"

        % ./a.out | hexdump -C
        00000000  22 61 00 01 62 22 20 3d  20 22 61 5c 75 30 30 30  |"a..b" = "a\u000|
        00000010  30 5c 75 30 30 30 31 62  22 0a 0a                 |0\u0001b"..|
2023-10-10 09:03:33 +01:00
..
color.hpp refactor: style update 2022-05-29 00:37:39 +09:00
combinator.hpp fix a compile warning C26478 2021-10-09 11:12:58 +09:00
comments.hpp Don't deliberately dereference the null pointer 2022-09-29 17:59:28 +02:00
datetime.hpp Initialize data members for defaulted c'tors 2022-09-29 17:59:27 +02:00
exception.hpp fix: add missing include file and specifiers 2022-09-29 20:14:58 +09:00
from.hpp fix: remove needless include file 2021-05-25 21:40:41 +09:00
get.hpp feat: add get<T> overload with toml::value& 2023-05-27 00:16:17 +09:00
into.hpp fix: remove needless include file 2021-05-25 21:40:41 +09:00
lexer.hpp Merge pull request #193 from lukash/replace-fstream 2022-09-24 00:17:52 +09:00
literal.hpp fix: disallow null char at the end of input 2021-12-14 22:33:58 +09:00
macros.hpp fix: enable to control macro definition 2021-04-02 17:21:25 +09:00
parser.hpp fix: prevent windows minmax macro 2023-02-12 20:27:14 +09:00
region.hpp Fix for case when vector iterator is raw pointer 2023-03-16 23:02:19 +07:00
result.hpp feat: use detail::none_t instead of char 2019-05-31 17:07:52 +09:00
serializer.hpp Escape control characters in keys 2023-10-10 09:03:33 +01:00
source_location.hpp Support changing color mode at runtime 2022-05-27 00:01:28 +09:00
storage.hpp refactor: add explicit to ctors of internal types 2020-01-24 15:58:24 +09:00
string.hpp feat: workaround __cplusplus problem on MSVC 2021-12-17 22:29:57 +09:00
traits.hpp feat: workaround __cplusplus problem on MSVC 2021-12-17 22:29:57 +09:00
types.hpp Spelling fixes 2021-08-27 19:52:45 -04:00
utility.hpp feat: workaround __cplusplus problem on MSVC 2021-12-17 22:29:57 +09:00
value.hpp fix: #192 quick fix by checking address 2022-07-01 01:09:22 +09:00
version.hpp fix: Allow MSVC to have old version 2021-12-18 00:36:20 +09:00