+QString charFilterRegExp(QString const & filter)
+{
+ QString re = ".*";
+ for (QChar const & c : filter) {
+ if (c.isLower())
+ re += "[" + QRegularExpression::escape(c)
+ + QRegularExpression::escape(c.toUpper()) + "]";
+ else
+ re += QRegularExpression::escape(c);
+ }
+ return re;
+}
+
+QString charFilterRegExpC(QString const & filter)
+{
+ QString re = "(";
+ for (QChar const & c : filter) {
+ if (c.isLower())
+ re += "[" + QRegularExpression::escape(c)
+ + QRegularExpression::escape(c.toUpper()) + "]";
+ else
+ re += QRegularExpression::escape(c);
+ }
+ return re + ")";
+}
+
+QString locLengthString(QString const & str)
+{
+ QLocale loc;
+ QString res = str;
+ return res.replace(QString("."), loc.decimalPoint());
+}
+
+
+docstring locLengthDocString(docstring const str)
+{
+ return qstring_to_ucs4(locLengthString(toqstr(str)));
+}
+
+
+QString unlocLengthString(QString const & str)
+{
+ QLocale loc;
+ QString res = str;
+ return res.replace(loc.decimalPoint(), QString("."));
+}
+
+