File indexing completed on 2025-01-05 03:59:22
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2006-2007 Torsten Rahn <tackat@kde.org> 0004 // 0005 0006 #ifndef MARBLE_MARBLEPLACEMARKMODEL_P_H 0007 #define MARBLE_MARBLEPLACEMARKMODEL_P_H 0008 0009 #include <QChar> 0010 #include <QRegularExpression> 0011 #include <QString> 0012 0013 namespace Marble 0014 { 0015 0016 namespace GeoString 0017 { 0018 static const QRegularExpression combiningDiacriticalMarks(QString::fromUtf8("[\\x0300-\\x036F]+")); 0019 0020 QString deaccent( const QString& accentString ) 0021 { 0022 QString result; 0023 0024 result = accentString.normalized( QString::NormalizationForm_D ).remove( combiningDiacriticalMarks ); 0025 result.replace(QChar(0x00F8), QLatin1Char('o')); 0026 result.replace(QChar(0x0142), QLatin1Char('l')); 0027 return result; 0028 } 0029 } 0030 } 0031 0032 #endif