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
b58a93b8
Commit
b58a93b8
authored
Aug 14, 2015
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merged #111
parent
6f2da1a3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
0 deletions
+13
-0
README.md
README.md
+1
-0
json.hpp
src/json.hpp
+2
-0
json.hpp.re2c
src/json.hpp.re2c
+2
-0
unit.cpp
test/unit.cpp
+8
-0
No files found.
README.md
View file @
b58a93b8
...
@@ -373,6 +373,7 @@ I deeply appreciate the help of the following people.
...
@@ -373,6 +373,7 @@ I deeply appreciate the help of the following people.
-
[
易思龙
](
https://github.com/likebeta
)
implemented a conversion from anonymous enums.
-
[
易思龙
](
https://github.com/likebeta
)
implemented a conversion from anonymous enums.
-
[
kepkin
](
https://github.com/kepkin
)
patiently pushed forward the support for Microsoft Visual studio.
-
[
kepkin
](
https://github.com/kepkin
)
patiently pushed forward the support for Microsoft Visual studio.
-
[
gregmarr
](
https://github.com/gregmarr
)
simplified the implementation of reverse iterators.
-
[
gregmarr
](
https://github.com/gregmarr
)
simplified the implementation of reverse iterators.
-
[
Caio Luppi
](
https://github.com/caiovlp
)
fixed a bug in the Unicode handling.
Thanks a lot for helping out!
Thanks a lot for helping out!
...
...
src/json.hpp
View file @
b58a93b8
...
@@ -4692,6 +4692,8 @@ class basic_json
...
@@ -4692,6 +4692,8 @@ class basic_json
// print character c as \uxxxx
// print character c as \uxxxx
sprintf
(
&
result
[
pos
+
1
],
"u%04x"
,
int
(
c
));
sprintf
(
&
result
[
pos
+
1
],
"u%04x"
,
int
(
c
));
pos
+=
6
;
pos
+=
6
;
// overwrite trailing null character
result
[
pos
]
=
'\\'
;
}
}
else
else
{
{
...
...
src/json.hpp.re2c
View file @
b58a93b8
...
@@ -4692,6 +4692,8 @@ class basic_json
...
@@ -4692,6 +4692,8 @@ class basic_json
// print character c as \uxxxx
// print character c as \uxxxx
sprintf(&result[pos + 1], "u%04x", int(c));
sprintf(&result[pos + 1], "u%04x", int(c));
pos += 6;
pos += 6;
// overwrite trailing null character
result[pos] = '\\';
}
}
else
else
{
{
...
...
test/unit.cpp
View file @
b58a93b8
...
@@ -10194,4 +10194,12 @@ TEST_CASE("regression tests")
...
@@ -10194,4 +10194,12 @@ TEST_CASE("regression tests")
// hexadecimal "a"
// hexadecimal "a"
CHECK
(
j
.
dump
()
==
"{
\"
binary string
\"
:
\"\\
u0000asdf
\\
n
\"
,
\"
int64
\"
:10}"
);
CHECK
(
j
.
dump
()
==
"{
\"
binary string
\"
:
\"\\
u0000asdf
\\
n
\"
,
\"
int64
\"
:10}"
);
}
}
SECTION
(
"issue #111 - subsequent unicode chars"
)
{
std
::
string
bytes
{
0x7
,
0x7
};
json
j
;
j
[
"string"
]
=
bytes
;
CHECK
(
j
[
"string"
]
==
"\u0007\u0007"
);
}
}
}
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