| 142 | QString from; |
| 143 | |
| 144 | foreach (QString codec, codecs) { |
| 145 | QTextCodec *tc = QTextCodec::codecForName(qPrintable(codec)); |
| 146 | |
| 147 | const QString text = tc->toUnicode(buffer.constData(), buffer.size()); |
| 148 | |
| 149 | QStringList chars = QString::fromUtf8("ą/ś/ż/ć/ń/ł/ó/ę").split("/"); |
| 150 | |
| 151 | int found = 0; |
| 152 | |
| 153 | foreach (QString c, chars) { |
| 154 | if (text.contains(c, Qt::CaseInsensitive)) { |
| 155 | ++found; |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | if (found >= bestMatch) { |
| 160 | bestMatch = found; |
| 161 | from = codec; |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | return from; |
| 166 | } |
nothing calls this directly
no outgoing calls
no test coverage detected