diff options
author | B Stack <bgstack15@gmail.com> | 2020-09-01 00:24:17 +0000 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2020-09-01 00:24:17 +0000 |
commit | 5a3f52b016581a6a0cb4513614b6c620d365dde2 (patch) | |
tree | acfdfb3e1046db87040477033fda0df76d92916a /zen/utf.h | |
parent | Merge branch '11.0' into 'master' (diff) | |
parent | add upstream 11.1 (diff) | |
download | FreeFileSync-5a3f52b016581a6a0cb4513614b6c620d365dde2.tar.gz FreeFileSync-5a3f52b016581a6a0cb4513614b6c620d365dde2.tar.bz2 FreeFileSync-5a3f52b016581a6a0cb4513614b6c620d365dde2.zip |
Merge branch '11.1' into 'master'11.1
add upstream 11.1
See merge request opensource-tracking/FreeFileSync!25
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; |