diff options
author | B Stack <bgstack15@gmail.com> | 2020-08-31 20:07:13 -0400 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2020-08-31 20:07:13 -0400 |
commit | 8a27fa9c617533e76673ce61a65e2ba869b52208 (patch) | |
tree | acfdfb3e1046db87040477033fda0df76d92916a /zen/utf.h | |
parent | Merge branch '11.0' into 'master' (diff) | |
download | FreeFileSync-8a27fa9c617533e76673ce61a65e2ba869b52208.tar.gz FreeFileSync-8a27fa9c617533e76673ce61a65e2ba869b52208.tar.bz2 FreeFileSync-8a27fa9c617533e76673ce61a65e2ba869b52208.zip |
add upstream 11.1
Diffstat (limited to 'zen/utf.h')
-rw-r--r-- | zen/utf.h | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -299,11 +299,10 @@ private: const CodePoint* it_; const CodePoint* last_; }; - +} template <class CharType> -using UtfDecoder = UtfDecoderImpl<CharType, sizeof(CharType)>; -} +using UtfDecoder = impl::UtfDecoderImpl<CharType, sizeof(CharType)>; //------------------------------------------------------------------------------------------- @@ -325,7 +324,7 @@ template <class UtfString> inline size_t unicodeLength(const UtfString& str) //return number of code points (+ correctly handle broken UTF encoding) { size_t uniLen = 0; - impl::UtfDecoder<GetCharTypeT<UtfString>> decoder(strBegin(str), strLength(str)); + UtfDecoder<GetCharTypeT<UtfString>> decoder(strBegin(str), strLength(str)); while (decoder.getNext()) ++uniLen; return uniLen; @@ -344,7 +343,7 @@ UtfString getUnicodeSubstring(const UtfString& str, size_t uniPosFirst, size_t u UtfDecoder<CharType> decoder(strBegin(str), strLength(str)); for (size_t uniPos = 0; std::optional<CodePoint> cp = decoder.getNext(); ++uniPos) //[!] declaration in condition part of the for-loop - if (uniPosFirst <= uniPos) + if (uniPos >= uniPosFirst) { if (uniPos >= uniPosLast) break; |