summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/unicode.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/unicode.h b/include/unicode.h
index 37342a1..277c4de 100644
--- a/include/unicode.h
+++ b/include/unicode.h
@@ -30,7 +30,7 @@ namespace unicode {
template<typename T>
static inline bool is_valid_unicode(const T& value)
{
- return value <= 0x10FFFF && (value <= 0xD7FF || value >= 0xE000);
+ return value <= 0xD7FF || (value >= 0xE000 && value <= 0x10FFFF);
}
}
@@ -475,7 +475,7 @@ namespace unicode {
if (value > 255)
throw std::invalid_argument("Bad Unicode value above 255: "s + std::to_string(static_cast<uint32_t>(value)));
- s.push_back(static_cast<utf8_t>(value));
+ s.push_back(static_cast<typename iso_back_insert_iterator::value_type>(value));
return *this;
}