MCPcopy Create free account
hub / github.com/QNapi/qnapi / replaceDiacriticsWithASCII

Method replaceDiacriticsWithASCII

libqnapi/src/utils/encodingutils.cpp:119–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119QString EncodingUtils::replaceDiacriticsWithASCII(const QString &str) const {
120 QString output;
121 for (int i = 0; i < str.length(); i++) {
122 QChar c = str[i];
123 int dIndex = diacritics.indexOf(c);
124 if (dIndex < 0) {
125 output.append(c);
126 } else {
127 QString replacement = replacements[dIndex];
128 output.append(replacement);
129 }
130 }
131 return output;
132}
133
134QString EncodingUtils::detectBufferEncoding(const QByteArray &buffer) const {
135 QTextCodec::ConverterState state;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected