11#include <rtl/ustrbuf.hxx>
13#include <unicode/translit.h>
25 UErrorCode nStatus = U_ZERO_ERROR;
26 m_transliterator.reset( icu::Transliterator::createInstance(
"NFD; [:M:] Remove; NFC",
27 UTRANS_FORWARD, nStatus) );
28 if (U_FAILURE(nStatus))
36 throw css::uno::RuntimeException();
38 icu::UnicodeString aChar(nInChar);
44 if (aChar.length() > 1)
52 sal_Int32 nCount, css::uno::Sequence<sal_Int32>* pOffset)
55 throw css::uno::RuntimeException();
57 if (nStartPos < 0 || nStartPos + nCount > rInStr.getLength())
58 throw css::uno::RuntimeException();
62 OUStringBuffer aOutBuf(
nCount);
64 std::vector<sal_Int32> aOffset;
67 sal_Int32 nPosition = nStartPos;
68 while (nPosition < nStartPos +
nCount)
70 sal_Int32
nIndex = nPosition;
71 UChar32 nChar = rInStr.iterateCodePoints(&
nIndex);
72 icu::UnicodeString aUStr(nChar);
75 aOutBuf.append(
reinterpret_cast<const sal_Unicode*
>(aUStr.getBuffer()), aUStr.length());
77 std::fill_n(std::back_inserter(aOffset), aUStr.length(), nPosition);
83 return aOutBuf.makeStringAndClear();
87 icu::UnicodeString aUStr(
reinterpret_cast<const UChar*
>(rInStr.getStr()) + nStartPos,
nCount);
89 return OUString(
reinterpret_cast<const sal_Unicode*
>(aUStr.getBuffer()), aUStr.length());
OUString foldingImpl(const OUString &rInStr, sal_Int32 nStartPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 > *pOffset) override
sal_Unicode SAL_CALL transliterateChar2Char(sal_Unicode nInChar) override
std::unique_ptr< icu::Transliterator > m_transliterator
i18nutil::oneToOneMapping * table
const char * transliterationName
const char * implementationName
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
Constant values shared between i18npool and, for example, the number formatter.