Disallow non-ASCII and ASCII control characters in FAT label
FAT label is interpreted according to current OEM DOS codepage which is system dependent setting. But most DOS codepages have same characters in printable ASCII range, so this is the only safe range of characters which are interpreted in same way by most programs and operating systems. Also all DOS codepages are only 8bit, so characters above U+FF cannot be stored to FAT label.
This commit is contained in:
parent
5a30aff288
commit
e957c220bd
|
@ -105,7 +105,7 @@ int fat16::maxLabelLength() const
|
||||||
QValidator* fat16::labelValidator(QObject *parent) const
|
QValidator* fat16::labelValidator(QObject *parent) const
|
||||||
{
|
{
|
||||||
QRegularExpressionValidator *m_LabelValidator = new QRegularExpressionValidator(parent);
|
QRegularExpressionValidator *m_LabelValidator = new QRegularExpressionValidator(parent);
|
||||||
m_LabelValidator->setRegularExpression(QRegularExpression(QStringLiteral(R"(^[^*?.,;:\/\\|+=<>\[\]"]*$)")));
|
m_LabelValidator->setRegularExpression(QRegularExpression(QStringLiteral(R"(^[^\x{0000}-\x{001F}\x{007F}-\x{FFFF}*?.,;:\/\\|+=<>\[\]"]*$)")));
|
||||||
return m_LabelValidator;
|
return m_LabelValidator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue