diff --git a/src/McBopomofo.cpp b/src/McBopomofo.cpp index d862972..ce673e1 100644 --- a/src/McBopomofo.cpp +++ b/src/McBopomofo.cpp @@ -747,13 +747,9 @@ fcitx::CandidateLayoutHint McBopomofoEngine::getCandidateLayoutHint() const { if (choosingCandidate != nullptr) { auto candidates = choosingCandidate->candidates; for (auto candidate : candidates) { - if (candidate.value.length() > 8) { - return fcitx::CandidateLayoutHint::Vertical; - } - } - if (candidates.size() > 0) { - auto firstCandidate = candidates[0]; - if (firstCandidate.value.length() > 8) { + std::wstring_convert, char32_t> conv; + auto u32 = conv.from_bytes(candidate.value); + if (u32.size() > 8) { return fcitx::CandidateLayoutHint::Vertical; } }