Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
json
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
json
Commits
b1be1b45
Commit
b1be1b45
authored
Feb 15, 2015
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor change
parent
d31d1ca6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
+9
-2
json.hpp
src/json.hpp
+1
-1
json.hpp.re2c
src/json.hpp.re2c
+1
-1
unit.cpp
test/unit.cpp
+7
-0
No files found.
src/json.hpp
View file @
b1be1b45
...
@@ -1491,7 +1491,7 @@ class basic_json
...
@@ -1491,7 +1491,7 @@ class basic_json
default
:
default
:
{
{
if
(
c
<=
0x1f
)
if
(
c
>=
0
and
c
<=
0x1f
)
{
{
// control characters (everything between 0x00 and 0x1f)
// control characters (everything between 0x00 and 0x1f)
// -> create four-digit hex representation
// -> create four-digit hex representation
...
...
src/json.hpp.re2c
View file @
b1be1b45
...
@@ -1491,7 +1491,7 @@ class basic_json
...
@@ -1491,7 +1491,7 @@ class basic_json
default:
default:
{
{
if (c <= 0x1f)
if (c
>= 0 and c
<= 0x1f)
{
{
// control characters (everything between 0x00 and 0x1f)
// control characters (everything between 0x00 and 0x1f)
// -> create four-digit hex representation
// -> create four-digit hex representation
...
...
test/unit.cpp
View file @
b1be1b45
...
@@ -1080,6 +1080,13 @@ TEST_CASE("object inspection")
...
@@ -1080,6 +1080,13 @@ TEST_CASE("object inspection")
auto
s
=
json
(
42.23
).
dump
();
auto
s
=
json
(
42.23
).
dump
();
CHECK
(
s
.
find
(
"42.23"
)
!=
std
::
string
::
npos
);
CHECK
(
s
.
find
(
"42.23"
)
!=
std
::
string
::
npos
);
}
}
SECTION
(
"dump and non-ASCII characters"
)
{
CHECK
(
json
(
"ä"
).
dump
()
==
"
\"
ä
\"
"
);
CHECK
(
json
(
"Ö"
).
dump
()
==
"
\"
Ö
\"
"
);
CHECK
(
json
(
"❤️"
).
dump
()
==
"
\"
❤️
\"
"
);
}
}
}
SECTION
(
"return the type of the object (explicit)"
)
SECTION
(
"return the type of the object (explicit)"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment