Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yaml-cpp
Overview
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
lvzhengyang
yaml-cpp
Commits
3bd412cc
Commit
3bd412cc
authored
Mar 23, 2014
by
Jesse Beder
Browse files
Options
Browse Files
Download
Plain Diff
Merge from core
parents
253c80d0
114db223
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
src/stream.cpp
+3
-2
test/integration/encoding_test.cpp
+4
-4
No files found.
src/stream.cpp
View file @
3bd412cc
...
@@ -365,13 +365,13 @@ void Stream::StreamInUtf16() const {
...
@@ -365,13 +365,13 @@ void Stream::StreamInUtf16() const {
}
}
unsigned
long
chLow
=
(
static_cast
<
unsigned
long
>
(
bytes
[
nBigEnd
])
<<
8
)
|
unsigned
long
chLow
=
(
static_cast
<
unsigned
long
>
(
bytes
[
nBigEnd
])
<<
8
)
|
static_cast
<
unsigned
long
>
(
bytes
[
1
^
nBigEnd
]);
static_cast
<
unsigned
long
>
(
bytes
[
1
^
nBigEnd
]);
if
(
chLow
<
0xDC00
||
ch
>=
0xE000
)
{
if
(
chLow
<
0xDC00
||
ch
Low
>=
0xE000
)
{
// Trouble...not a low surrogate. Dump a REPLACEMENT CHARACTER into the
// Trouble...not a low surrogate. Dump a REPLACEMENT CHARACTER into the
// stream.
// stream.
QueueUnicodeCodepoint
(
m_readahead
,
CP_REPLACEMENT_CHARACTER
);
QueueUnicodeCodepoint
(
m_readahead
,
CP_REPLACEMENT_CHARACTER
);
// Deal with the next UTF-16 unit
// Deal with the next UTF-16 unit
if
(
chLow
<
0xD800
||
ch
>=
0xE000
)
{
if
(
chLow
<
0xD800
||
ch
Low
>=
0xE000
)
{
// Easiest case: queue the codepoint and return
// Easiest case: queue the codepoint and return
QueueUnicodeCodepoint
(
m_readahead
,
ch
);
QueueUnicodeCodepoint
(
m_readahead
,
ch
);
return
;
return
;
...
@@ -391,6 +391,7 @@ void Stream::StreamInUtf16() const {
...
@@ -391,6 +391,7 @@ void Stream::StreamInUtf16() const {
// Add the surrogacy offset
// Add the surrogacy offset
ch
+=
0x10000
;
ch
+=
0x10000
;
break
;
}
}
}
}
...
...
test/integration/encoding_test.cpp
View file @
3bd412cc
...
@@ -139,22 +139,22 @@ TEST_F(EncodingTest, UTF8_BOM) {
...
@@ -139,22 +139,22 @@ TEST_F(EncodingTest, UTF8_BOM) {
Run
();
Run
();
}
}
TEST_F
(
EncodingTest
,
DISABLED_
UTF16LE_noBOM
)
{
TEST_F
(
EncodingTest
,
UTF16LE_noBOM
)
{
SetUpEncoding
(
&
EncodeToUtf16LE
,
false
);
SetUpEncoding
(
&
EncodeToUtf16LE
,
false
);
Run
();
Run
();
}
}
TEST_F
(
EncodingTest
,
DISABLED_
UTF16LE_BOM
)
{
TEST_F
(
EncodingTest
,
UTF16LE_BOM
)
{
SetUpEncoding
(
&
EncodeToUtf16LE
,
true
);
SetUpEncoding
(
&
EncodeToUtf16LE
,
true
);
Run
();
Run
();
}
}
TEST_F
(
EncodingTest
,
DISABLED_
UTF16BE_noBOM
)
{
TEST_F
(
EncodingTest
,
UTF16BE_noBOM
)
{
SetUpEncoding
(
&
EncodeToUtf16BE
,
false
);
SetUpEncoding
(
&
EncodeToUtf16BE
,
false
);
Run
();
Run
();
}
}
TEST_F
(
EncodingTest
,
DISABLED_
UTF16BE_BOM
)
{
TEST_F
(
EncodingTest
,
UTF16BE_BOM
)
{
SetUpEncoding
(
&
EncodeToUtf16BE
,
true
);
SetUpEncoding
(
&
EncodeToUtf16BE
,
true
);
Run
();
Run
();
}
}
...
...
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