Commit dbb9a16a authored by Ralf Habacker's avatar Ralf Habacker
Browse files

Add support for importing chinese (GB18030) encoded rational rose files.

CCBUG:331769
parent 0460ab0d
......@@ -381,8 +381,20 @@ bool loadFromMDL(QIODevice& file)
while (!(line = stream.readLine()).isNull()) {
linum++;
if (line.contains(QRegExp("^\\s*\\(object Petal"))) {
while (!(line = stream.readLine()).isNull() && !line.contains(')')) {
bool finish = false;
while (!(line = stream.readLine()).isNull()) {
linum++; // CHECK: do we need petal version info?
if (line.contains(')')) {
finish = true;
line = line.replace(QLatin1String(")"),QLatin1String(""));
}
QStringList a = line.trimmed().split(QRegExp("\\s+"));
if (a.size() == 2) {
if (a[0] == "charSet" && a[1] == "134")
stream.setCodec("GB18030");
}
if (finish)
break;
}
if (line.isNull())
break;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment