projects
/
libs
/
core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
017fead
)
Refuse to encode invalid Unicode characters in UTF-8
author
Mikko Rasa
<tdb@tdb.fi>
Tue, 4 Sep 2012 06:46:19 +0000
(09:46 +0300)
committer
Mikko Rasa
<tdb@tdb.fi>
Tue, 4 Sep 2012 06:46:19 +0000
(09:46 +0300)
source/stringcodec/utf8.cpp
patch
|
blob
|
history
diff --git
a/source/stringcodec/utf8.cpp
b/source/stringcodec/utf8.cpp
index c6d1990d0b00e6ae36870e8b0af7978f09cdb9fa..b75b39780edfa6269ad09fa780ca9a565f574872 100644
(file)
--- a/
source/stringcodec/utf8.cpp
+++ b/
source/stringcodec/utf8.cpp
@@
-7,7
+7,7
@@
namespace StringCodec {
void Utf8::Encoder::encode_char(unichar ch, string &buf)
{
- if(
ch<0 || ch>0x10FFFF
)
+ if(
!is_valid_unichar(ch)
)
return error(ch, buf, invalid_character(ch, "UTF-8"));
unsigned bytes = 1;