Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
json
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
json
Commits
a01ec918
Commit
a01ec918
authored
Jul 25, 2016
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor changes
parent
d08e013d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
7 deletions
+19
-7
src/json.hpp
src/json.hpp
+9
-3
src/json.hpp.re2c
src/json.hpp.re2c
+9
-3
test/src/unit.cpp
test/src/unit.cpp
+1
-1
No files found.
src/json.hpp
View file @
a01ec918
...
...
@@ -7386,12 +7386,18 @@ class basic_json
lexer
operator
=
(
const
lexer
&
)
=
delete
;
/*!
@brief create a string from a Unicode code point
@brief create a string from one or two Unicode code points
There are two cases: (1) @a codepoint1 is in the Basic Multilingual
Plane (U+0000 through U+FFFF) and @a codepoint2 is 0, or (2)
@a codepoint1 and @a codepoint2 are a UTF-16 surrogate pair to
represent a code point above U+FFFF.
@param[in] codepoint1 the code point (can be high surrogate)
@param[in] codepoint2 the code point (can be low surrogate or 0)
@return string representation of the code point
@return string representation of the code point; the length of the
result string is between 1 and 4 characters.
@throw std::out_of_range if code point is > 0x10ffff; example: `"code
points above 0x10FFFF are invalid"`
...
...
@@ -7405,7 +7411,7 @@ class basic_json
static
string_t
to_unicode
(
const
std
::
size_t
codepoint1
,
const
std
::
size_t
codepoint2
=
0
)
{
// calculate the codepoint from the given code points
// calculate the code
point from the given code points
std
::
size_t
codepoint
=
codepoint1
;
// check if codepoint1 is a high surrogate
...
...
src/json.hpp.re2c
View file @
a01ec918
...
...
@@ -7386,12 +7386,18 @@ class basic_json
lexer operator=(const lexer&) = delete;
/*!
@brief create a string from a Unicode code point
@brief create a string from one or two Unicode code points
There are two cases: (1) @a codepoint1 is in the Basic Multilingual
Plane (U+0000 through U+FFFF) and @a codepoint2 is 0, or (2)
@a codepoint1 and @a codepoint2 are a UTF-16 surrogate pair to
represent a code point above U+FFFF.
@param[in] codepoint1 the code point (can be high surrogate)
@param[in] codepoint2 the code point (can be low surrogate or 0)
@return string representation of the code point
@return string representation of the code point; the length of the
result string is between 1 and 4 characters.
@throw std::out_of_range if code point is > 0x10ffff; example: `"code
points above 0x10FFFF are invalid"`
...
...
@@ -7405,7 +7411,7 @@ class basic_json
static string_t to_unicode(const std::size_t codepoint1,
const std::size_t codepoint2 = 0)
{
// calculate the codepoint from the given code points
// calculate the code
point from the given code points
std::size_t codepoint = codepoint1;
// check if codepoint1 is a high surrogate
...
...
test/src/unit.cpp
View file @
a01ec918
...
...
@@ -12299,7 +12299,7 @@ TEST_CASE("Unicode", "[hide]")
return
ss
.
str
();
};
// generate all UTF8 code points; in total, 1112064 code points are
// generate all UTF
-
8 code points; in total, 1112064 code points are
// generated: 0x1FFFFF code points - 2047 invalid values between
// 0xD800 and 0xDFFF.
for
(
std
::
size_t
cp
=
0
;
cp
<=
0x10FFFFu
;
++
cp
)
...
...
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